Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0dc56a0
fix: stop automatic profile deletion replay
ben-kaufman Oct 24, 2026
1b8a6db
docs: associate deletion fix with PR 1122
ben-kaufman Oct 24, 2026
f204e05
fix: serialize backup observation lifecycle
ben-kaufman Oct 25, 2026
be554fc
Merge backup lifecycle repair into profile deletion recovery
ben-kaufman Oct 25, 2026
538f45c
fix: retain backup changes during observation restart
ben-kaufman Oct 25, 2026
d1745fb
Merge backup restart recovery into profile deletion fix
ben-kaufman Oct 25, 2026
1ad665f
test: wait for unobstructed USDT back navigation
ben-kaufman Oct 25, 2026
6577437
Merge parent UI synchronization into profile deletion fix
ben-kaufman Oct 25, 2026
ca10ace
test: retain navigation timeout evidence
ben-kaufman Oct 25, 2026
494c949
fix: retry backup transport failures and coalesce status writes
ben-kaufman Oct 26, 2026
ff999a5
fix: complete wallet initialization once
ben-kaufman Oct 26, 2026
2416046
merge: adopt current recovery dependency stack
ben-kaufman Oct 27, 2026
14152f4
Merge current identity recovery parent
ben-kaufman Oct 27, 2026
d66019e
Merge backup lifecycle parent into profile deletion recovery
ben-kaufman Oct 27, 2026
7f54d7b
Align profile recovery with current parent ancestry
ben-kaufman Oct 27, 2026
bfc4a5e
fix: retain backup changes while stopped uploads drain
ben-kaufman Oct 27, 2026
e12df99
Merge restore parent and preserve foreground backup lifecycle
ben-kaufman Oct 27, 2026
162ea52
Merge validated foreground backup parent
ben-kaufman Oct 27, 2026
566b2ff
merge validated backup identity parent
ben-kaufman Oct 28, 2026
f3df6cd
merge validated backup lifecycle parent
ben-kaufman Oct 28, 2026
d33547c
Merge current identity recovery parent into backup lifecycle
ben-kaufman Oct 29, 2026
940d7f3
Merge current backup lifecycle parent into profile deletion
ben-kaufman Oct 29, 2026
8947f49
Merge current identity parent while preserving backup drains
ben-kaufman Oct 29, 2026
bee8975
Merge validated backup parent into profile deletion recovery
ben-kaufman Oct 29, 2026
1dd6d2f
test: isolate identity publication return deadline
ben-kaufman Oct 29, 2026
262a447
Merge wallet recovery ordering into backup lifecycle guards
ben-kaufman Oct 30, 2026
49f88a0
Merge backup lifecycle guards into profile session recovery
ben-kaufman Oct 30, 2026
fb25166
Merge validated restore identity parent into backup lifecycle recovery
ben-kaufman Oct 31, 2026
a6647db
Merge validated backup lifecycle parent
ben-kaufman Oct 31, 2026
2c0c100
Merge queued allowance admission fix
ben-kaufman Nov 1, 2026
2f80b44
Merge queued allowance admission into profile recovery
ben-kaufman Nov 1, 2026
ff3ba67
Merge current restore identity parent into backup lifecycle
ben-kaufman Nov 1, 2026
5a5044a
Merge validated backup parent into restore identity recovery
ben-kaufman Nov 1, 2026
c633688
merge: carry cached backup protection into observer recovery
ben-kaufman Nov 3, 2026
2d60492
merge: preserve cached backups during session recovery
ben-kaufman Nov 3, 2026
4e6c06e
fix: publish backup idle after scheduled admission cleanup
ben-kaufman Nov 3, 2026
595898e
Merge scheduled backup completion fix into profile session recovery
ben-kaufman Nov 3, 2026
11fb65d
fix: retry temporary backup authentication failures
ben-kaufman Nov 3, 2026
b44f025
merge: compose backup auth recovery and clipboard fixture
ben-kaufman Nov 3, 2026
c75acf3
fix: prevent backup requests from crossing wallet removal
ben-kaufman Nov 4, 2026
eb959e4
Merge VSS ownership parent before durable wipe integration
ben-kaufman Nov 4, 2026
f514d19
Merge durable wipe recovery into backup observation lifecycle
ben-kaufman Nov 4, 2026
85a87f0
Merge durable wipe recovery into profile deletion recovery
ben-kaufman Nov 4, 2026
003ea7e
Merge expired wallet cleanup admission fix
ben-kaufman Nov 5, 2026
2079437
Merge expired wallet cleanup admission fix
ben-kaufman Nov 5, 2026
5cae328
Merge identity recovery into backup lifecycle
ben-kaufman Nov 5, 2026
c80a599
Merge validated backup parent into identity recovery
ben-kaufman Nov 5, 2026
675f8bd
Merge metadata recovery into backup lifecycle
ben-kaufman Nov 5, 2026
a214b06
Merge metadata recovery into profile deletion
ben-kaufman Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions Bitkit/Managers/PubkyProfileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1635,14 +1635,6 @@ class PubkyProfileManager: ObservableObject {
}
}

func refreshSessionIfPossible(after error: Error) async -> Bool {
await Self.refreshSessionIfPossible(
after: error,
loadKeychainString: { try Keychain.loadString(key: $0) },
signInWithSecretKey: { try await PubkyService.signIn(secretKeyHex: $0) }
)
}

// MARK: - Cached Profile Metadata

private static let cachedNameKey = "pubky_profile_name"
Expand Down Expand Up @@ -2020,50 +2012,6 @@ class PubkyProfileManager: ObservableObject {
return false
}

nonisolated static func isSessionRefreshableError(_ error: Error) -> Bool {
let errorText = [
(error as? AppError)?.debugMessage,
error.localizedDescription,
String(describing: error),
]
.compactMap { $0?.lowercased() }

return errorText.contains {
($0.contains("authfailed") || $0.contains("authentication failed") || $0.contains("sessionnotactive"))
|| ($0.contains("transport error") && $0.contains("/session"))
}
}

nonisolated static func refreshSessionIfPossible(
after error: Error,
loadKeychainString: (KeychainEntryType) throws -> String? = {
try Keychain.loadString(key: $0)
},
signInWithSecretKey: (String) async throws -> String,
publicKeyFromSecretKey: (String) throws -> String = {
try PubkyProfileManager.publicKeyFromSecretKey($0)
}
) async -> Bool {
guard isSessionRefreshableError(error) else {
return false
}

guard let secretKeyHex = activeSecretKeyHex(loadKeychainString: loadKeychainString) else {
Logger.warn("Cannot refresh pubky session without a secret key", context: "PubkyProfileManager")
return false
}

do {
_ = try await signInWithSecretKey(secretKeyHex)
_ = try publicKeyFromSecretKey(secretKeyHex)
Logger.info("Refreshed pubky session from local secret key", context: "PubkyProfileManager")
return true
} catch {
Logger.warn("Failed to refresh pubky session: \(error)", context: "PubkyProfileManager")
return false
}
}

nonisolated static func resolveSessionInitialization(
savedSessionSecret: String?,
storedSecretKeyHex: String?,
Expand Down
Loading
Loading