Skip to content

[iOS, macOS] Refresh card suffix on incoming Sync card number update#4805

Open
amddg44 wants to merge 3 commits into
mainfrom
anya/sync-card-suffix-fix
Open

[iOS, macOS] Refresh card suffix on incoming Sync card number update#4805
amddg44 wants to merge 3 commits into
mainfrom
anya/sync-card-suffix-fix

Conversation

@amddg44
Copy link
Copy Markdown
Contributor

@amddg44 amddg44 commented May 11, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1201462886803403/task/1214548114411709?focus=true
Tech Design URL:
CC:

Description

This PR fixes credit-card sync suffix consistency by running a one-time update of any stale stored suffixes and by always recalculating suffix when card numbers are updated.

Testing Steps

Test card numbers can be found here

  1. Start on main with iOS and macOS signed into the same Sync account.
  2. Create/sync a credit card ending in e.g. 1111 so it exists on both platforms.
  3. On macOS, update the card number to one with new last-4 digits.
  4. On iOS, go to the Credit Cards screen and confirm the suffix is still stale (1111)
  5. Switch both builds to this branch, launch iOS, go back to the Credit Cards screen, and verify suffix updated correctly.
  6. Update card number on iOS to new last-4, verify macOS updates with the new suffix.
  7. Update card number on macOS to a new last-4, verify iOS updates with the new suffix.

Impact and Risks

Low: Minor visual changes, small bug fixes, improvement to existing features


Internal references:

Definition of Done | Engineering Expectations | Tech Design Template


Note

Medium Risk
Touches credit-card sync storage and performs a one-time backfill that decrypts card data and updates the vault database; issues here could impact card display data or sync correctness.

Overview
Ensures cardSuffix stays in sync with cardNumber for credit cards coming from Sync by recalculating the suffix whenever a synced card number is stored/updated.

Adds a one-time post-sync backfill in CreditCardsProvider that decrypts existing stored card numbers, updates any stale cardSuffix values directly in the database, and gates the migration via a persisted key-value flag (plumbed through iOS/macOS adapters and tests).

Reviewed by Cursor Bugbot for commit 09bb80f. Bugbot is set up for automated code reviews on this repo. Configure here.

cursor[bot]

This comment was marked as resolved.

@amddg44 amddg44 requested a review from frosty May 11, 2026 20:54
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