Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cfd1cea
feat: upgrade paykit auth to rc50
ben-kaufman Aug 31, 2026
fdb11b3
chore: rename changelog fragment
ben-kaufman Aug 31, 2026
d3344e5
fix: reconcile paykit auth failures
ben-kaufman Aug 31, 2026
c7180ff
test: cover private endpoint reconciliation
ben-kaufman Sep 1, 2026
cc6f71c
test: use grant auth fixtures
ben-kaufman Sep 1, 2026
ee3df61
fix: approve external Pubky grants
ben-kaufman Sep 2, 2026
5987e14
fix: harden Pubky session recovery
ben-kaufman Sep 2, 2026
ab05014
test: cover external auth client ID
ben-kaufman Sep 2, 2026
c4f8fe2
fix: bound auth requester label
ben-kaufman Sep 3, 2026
7250d9d
fix: clear abandoned paykit sessions
ben-kaufman Sep 3, 2026
33e8df5
fix: harden Paykit session recovery
ben-kaufman Sep 4, 2026
9930806
fix: reset forgotten Paykit sessions
ben-kaufman Sep 4, 2026
5ad9fff
fix: preserve payment request history
ben-kaufman Sep 4, 2026
a63a036
fix: preserve private paykit receiver marker
ben-kaufman Sep 6, 2026
0293e47
fix: scope auth recovery to its completed session
ben-kaufman Sep 7, 2026
e05f181
refactor: remove paykit migration handling
ben-kaufman Sep 7, 2026
b5f5138
feat: support Pubky Ring signup
ben-kaufman Sep 2, 2026
01f819c
fix: complete Pubky Ring signup
ben-kaufman Sep 2, 2026
05aaecf
feat: support direct Pubky signup
ben-kaufman Sep 2, 2026
57f3c43
fix: complete Pubky signup handoff
ben-kaufman Sep 3, 2026
4f3960e
fix: recover failed pubky signup
ben-kaufman Sep 3, 2026
f972d7c
fix: recover and verify pubky signup state
ben-kaufman Sep 6, 2026
a2135a3
fix: require consent for every pubky signup
ben-kaufman Sep 7, 2026
1613c58
fix: preserve pubky homeserver on restore
ben-kaufman Sep 7, 2026
a3ebbc7
refactor: simplify pubky profile setup wiring
ben-kaufman Sep 8, 2026
8fce8ed
fix: prevent overlapping Pubky signup
ben-kaufman Sep 9, 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
9 changes: 8 additions & 1 deletion Bitkit/AppScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ struct AppScene: View {
PaykitFeatureFlags.enforceBuildAvailability()
ContactPaymentsService.enableAllPaymentOptions()

_app = StateObject(wrappedValue: AppViewModel(sheetViewModel: sheetViewModel, navigationViewModel: navigationViewModel))
_app = StateObject(wrappedValue: AppViewModel(
sheetViewModel: sheetViewModel,
navigationViewModel: navigationViewModel
))
_sheets = StateObject(wrappedValue: sheetViewModel)
_navigation = StateObject(wrappedValue: navigationViewModel)
let feeEstimatesManager = FeeEstimatesManager()
Expand Down Expand Up @@ -885,6 +888,10 @@ struct AppScene: View {
wallet.resetSendState(speed: settings.defaultTransactionSpeed)
return
}
} catch ScanHandlingError.pubkyAuthRequest {
guard paykitPaymentRequestManager.isCurrentPresentation(request) else { return }
_ = paykitPaymentRequestManager.markPresentedIfPending(request)
continue
} catch is CancellationError {
if app.ownsContactPaymentContext(contactPaymentContext) {
app.resetSendState()
Expand Down
46 changes: 46 additions & 0 deletions Bitkit/MainNavView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
import SwiftUI

enum PendingProfileSetupResumeState {
case inactive
case waiting
case ready

func shouldResume(didResume: inout Bool) -> Bool {
if self == .inactive {
didResume = false
}
guard self == .ready, !didResume else { return false }
didResume = true
return true
}
}

func resolvePendingProfileSetupResumeState(
isProfileSetupPending: Bool,
isPaykitUIActive: Bool,
isAuthenticated: Bool,
hasActiveSheet: Bool,
isReplacingSheet: Bool,
currentRoute: Route?
) -> PendingProfileSetupResumeState {
guard isProfileSetupPending else { return .inactive }
guard isPaykitUIActive, isAuthenticated, !hasActiveSheet, !isReplacingSheet, currentRoute != .createProfile else {
return .waiting
}
return .ready
}

struct MainNavView: View {
@AppStorage(PaykitFeatureFlags.uiEnabledKey) private var isPaykitUIEnabled = false

Expand All @@ -20,11 +50,23 @@ struct MainNavView: View {

@State private var showClipboardAlert = false
@State private var clipboardUri: String?
@State private var didResumePendingPubkyProfileSetup = false

private var isPaykitUIActive: Bool {
PaykitFeatureFlags.isUIAvailable && isPaykitUIEnabled
}

private var pendingProfileSetupResumeState: PendingProfileSetupResumeState {
Comment thread
ovitrif marked this conversation as resolved.
resolvePendingProfileSetupResumeState(
isProfileSetupPending: pubkyProfile.isProfileSetupPending,
isPaykitUIActive: isPaykitUIActive,
isAuthenticated: pubkyProfile.isAuthenticated,
hasActiveSheet: sheets.activeSheetConfiguration != nil,
isReplacingSheet: sheets.isReplacingSheet,
currentRoute: navigation.currentRoute
)
}

// Delay constants for clipboard processing
private static let nodeReadyDelayNanoseconds: UInt64 = 500_000_000 // 0.5 seconds
private static let statePropagationDelayNanoseconds: UInt64 = 500_000_000 // 0.5 seconds
Expand All @@ -39,6 +81,10 @@ struct MainNavView: View {
navigation.navigate(.spendingHwSigned)
}
}
.onChange(of: pendingProfileSetupResumeState, initial: true) { _, resumeState in
guard resumeState.shouldResume(didResume: &didResumePendingPubkyProfileSetup) else { return }
navigation.navigate(.createProfile)
}
.sheet(
item: $sheets.addTagSheetItem,
onDismiss: {
Expand Down
Loading
Loading