Skip to content

fix(web): stop Apple's passkey notification on every visit to Settings - #147

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/88-everytime-i-to-the-settings-page-in-my-m
Oct 20, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/88-everytime-i-to-the-settings-page-in-my-m

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

On an iPhone, every visit to Settings showed Apple's notification "Passkey Updated: The website "app.fctl.sh" changed the user name for your passkey to …". Settings called PublicKeyCredential.signalCurrentUserDetails with the account's email and name each time it opened. Apple's Passwords app reports every such signal, even when the email and name are the ones the passkey already has. Apple's guidance (WWDC25, What's new in passkeys) is to send it when the account's user name or email changes.

What changed

  • signalDetails (web/src/lib/passkeys.ts) gives the email and name only when they changed since this browser last gave them for the account. To tell, the browser keeps a short hash of them (32-bit FNV-1a) in localStorage under fctl:passkey-details:<user handle>. It never keeps the email or name themselves. It keeps the hash before the browser answers, for two reasons: Safari's signals haven't always answered (WebKit bug 298951), and React's StrictMode runs the effect twice in development. A refused signal drops the hash, so the next visit tries again.
  • Making a passkey keeps the hash too, because the new passkey already has the account's details. Before, adding a passkey in Settings set off the notification straight away.
  • Settings gives no details for an account without passkeys: there is nothing to rename.
  • signalAllAcceptedCredentials still goes on every visit, as Apple and Chrome suggest for keeping providers' lists current. It shows nothing when nothing is removed.

Each browser gives the details once more, on its first visit to Settings after this ships, because it has no hash yet. After that it gives them only when the name or primary email changes, including changes made in another browser or with the CLI. Safari clears a site's storage after seven days of use without a visit to it, so such a browser gives them once more too.

The privacy policy lists what app.fctl.sh keeps in the browser: hyperstructure/fctl-site#32 adds the hash. Merge the two together. Neither needs the other to build.

Verification

  • web/src/lib/passkeys.test.ts checks that the details:

    • go once per change, and once per account
    • don't go after making a passkey
    • go again after a refusal
    • never reach storage as text
    • don't go at all where the browser has no signals

    Four of the new tests fail against main's signalDetails.

  • cd web && npm run check && npm test (290 tests), and cargo xtask check --quick.

  • End to end with cargo xtask dev and Playwright's Chromium, which counted the signals Settings sent and made a real passkey with Chromium's virtual authenticator. The development build runs each effect twice (StrictMode).

    • On main, three visits to Settings sent the unchanged details six times.
    • On this branch, three visits sent none, because the account had no passkeys yet.
    • Making a passkey in Settings, then two more visits, sent none.
    • With the hash cleared, as in a browser that never gave the details, two visits sent one.
    • Changing the first name sent one with the new name. The next visit sent none.

Nothing changes in how the app looks, so there are no screenshots.

Made in fctl session https://app.fctl.sh/s/ses_01M5D7WM9NNB04APATMJR6Y1ZE

Settings told the browser's passkey provider the account's email and
name (signalCurrentUserDetails) each time it opened. Apple's Passwords
notifies the person of each such signal, changed or not ("Passkey
Updated: The website app.fctl.sh changed the user name for your passkey
to …"), so iPhones showed it on every visit.

The app now gives them only when they changed since this browser last
gave them, or made a passkey with them: it keeps a short hash of them
for each account in localStorage, never the email itself. Accounts
without passkeys get no such signal.
@kalaspuff
kalaspuff merged commit bd44518 into main Oct 20, 2026
5 checks passed
@kalaspuff
kalaspuff deleted the fctl/88-everytime-i-to-the-settings-page-in-my-m branch October 20, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant