Skip to content

fix: drop a held expiry toast on sign-out - #1093

Open
ovitrif wants to merge 2 commits into
masterfrom
fix/expiry-toast-sign-out
Open

ovitrif wants to merge 2 commits into
masterfrom
fix/expiry-toast-sign-out

Conversation

@ovitrif

@ovitrif ovitrif commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Refs #1051

Follow-up to #1068, from @coreyphillips' review #1068 (review).

Description

  • Drops an expired-request toast held behind the PIN screen when the Pubky session is cleared (sign-out, adopted source removed, session expired), so after unlock the user no longer sees an expiry toast for the profile that was just signed out. The reset sits next to the existing paykitPaymentRequestManager.clear() call.

Out of Scope

  • None.

Design

N/A — no UI changes.

Preview

N/A — removes a stale toast; no new UI.

QA Notes

Journeys

N/A

Manual Tests

  • With PIN on, let a pending request expire while Bitkit is in the background, remove the identity in its source app, return and unlock → no "The payment request has expired." toast — needs an adopted Pubky identity and a request with a short expiry

Automated Checks

  • ran a simulator build and SwiftFormat lint

@ovitrif ovitrif added this to the 3.2.0 milestone Oct 21, 2026
@ovitrif ovitrif self-assigned this Oct 21, 2026
@ovitrif
ovitrif requested review from jvsena42 and pwltr October 21, 2026 18:08
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-21T18:08:38.531115Z 49e83ef PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This change appears safe to merge.

Summary

Clears hasPendingExpiryToast when the Pubky session becomes .idle.

  • Ending a Pubky session clears any waiting payment-expiry toast.

Reviews (1) · Last reviewed commit: "fix: drop a held expiry toast on sign-ou..." · Reviewed by Greptile

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two independent reviews, nothing blocking a merge.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings. Clears hasPendingExpiryToast when the Pubky auth state drops to .idle, next to paykitPaymentRequestManager.clear(), so an expiry toast held behind the PIN screen is not shown for a profile that was just signed out. Reviewed 49e83ef, light tier, reasoned from the code and CI: the branch was not built here.

What I checked, and 3 candidates I ruled out

Read: AppScene.swift around the change (the authState onChange, queueSilentExpiryToast, showPendingExpiryToast, the isPinVerified and scenePhase handlers), PaykitPaymentRequestManager.clear() and recordSilentExpirations in PaykitPaymentRequestService.swift, and every authState = .idle site in PubkyProfileManager.swift.
CI: SwiftFormat, validate and detect-changes green; Run Tests, Run Integration Tests and build-local still pending when this was posted.

Ruled out

  • Not every sign-out path reaches .idle: sign-out, the failed restore and the expired session all go through clearAuthenticatedState() or set authState = .idle directly (PubkyProfileManager.swift:314, :1615), and PubkyAuthState has only .idle and .authenticated, so the handler sees each of them.
  • A queue right after the reset brings the toast back: clear() empties silentlyExpiredRequests and reportedSilentExpirationIds in the same main-actor pass, and queueSilentExpiryToast() returns early on an empty list.
  • Switching straight to another identity skips .idle: adoptRingIdentity and completeRingAdoption set .authenticated without going through .idle, so a held toast would survive a direct identity swap. That path also skips paykitPaymentRequestManager.clear(), which predates this PR, and the PR scopes itself to the cleared-session case, so it is not this diff's defect.

Merge confidence: 4/5, the unit and build jobs had not finished at review time, and no test covers the reset (the flag is view @State).

coreyphillips
coreyphillips previously approved these changes Oct 21, 2026

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked after replies, with no new commit since 49e83ef. Nothing blocking remains.

@ovitrif

ovitrif commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged master in (d32977f) to clear a conflict in AppScene.swift: master's allowances PR (#799) added paykitAllowanceManager.deactivate() in the same sign-out block; both lines are kept. No behaviour change.

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked after 71 new commits (2de9fac, 621fcda, 6eafd42, and 68 more). Nothing blocking remains.

@ovitrif

ovitrif commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

Run Tests fails at testPendingWalletSwitchResumesAfterTags on three attempts. It's not this PR's change: plain master at 35655ae8 fails the same test class locally. Tracked in #1096.

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked after replies, with no new commit since d32977f. Nothing blocking remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants