Skip to content

Unobfuscate TOTP previews when the scene becomes active - #563

Merged
bradleymackey merged 1 commit into
mainfrom
fix/totp-unobfuscate-on-active
Sep 15, 2026
Merged

bradleymackey merged 1 commit into
mainfrom
fix/totp-unobfuscate-on-active

Conversation

@bradleymackey

Copy link
Copy Markdown
Member

Problem

TOTP preview codes are obfuscated when the scene leaves .active (privacy cover for the app switcher), but the .active case only restarted timers — there was no unobfuscate path at all for TOTP (unobfuscateForPrivacy() existed only on the HOTP repository). A transient .inactive (Control Centre, system alert, app switcher peek) left every TOTP code showing as obfuscated until the next timer emission.

Fix

Mirror the HOTP semantics exactly:

  • TOTPPreviewViewRepository gains unobfuscateForPrivacy() (protocol + impl), iterating the cached view models with updateRemovePrivacyObfuscation() — same shape as HOTPPreviewViewRepositoryImpl.
  • TOTPPreviewViewGenerator.scenePhaseDidChange(.active) now unobfuscates before restarting timers, so codes reappear immediately instead of waiting for the next tick.

The privacy direction (obfuscate on .background/.inactive) is untouched.

Tests

  • Generator: .active calls unobfuscate + restart (renamed test, mirrors the HOTP generator suite); .background/.inactive assert unobfuscate is never called.
  • Repository: unobfuscateForPrivacy_unobfuscatesCodesHiddenForPrivacy — visible code → privacy-obfuscated → restored (mirrors the HOTP repository test).

Local verification: VaultFeedTests + VaultiOSTests schemes, all passed on iPhone 18 Pro Max / iOS 27.0.

⚠️ Automatic CI is still disabled (#548), so this is local verification only.

🤖 Generated with Claude Code

TOTP previews obfuscate on background/inactive but had no unobfuscate
path — unobfuscateForPrivacy() existed only for HOTP — so a transient
inactive (Control Centre, system alert) left codes hidden until the
next timer emission. Mirror the HOTP repository/generator semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bradleymackey
bradleymackey merged commit 770a4e8 into main Sep 15, 2026
@bradleymackey
bradleymackey deleted the fix/totp-unobfuscate-on-active branch September 15, 2026 05:30
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.

1 participant