Skip to content

KYC: Fix - show the Get Verified modal once per account, not on every launch - #2500

Draft
JohnathanWhite wants to merge 1 commit into
bitpay:developfrom
JohnathanWhite:fix/get-verified-modal-reshow
Draft

JohnathanWhite wants to merge 1 commit into
bitpay:developfrom
JohnathanWhite:fix/get-verified-modal-reshow

Conversation

@JohnathanWhite

@JohnathanWhite JohnathanWhite commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

What this fixes

The "Get Verified" KYC prompt on the Home screen pops up every time you open or refresh the app. For a verified user whose KYC is still notStarted, it fires ~1s after Home comes into focus — every single launch.

Why it happens

The only thing that stopped it from re-appearing was an in-memory flag, kycGetVerifiedModalShown. That flag was on the redux-persist blacklist, so it was never saved — it reset to false on every launch, and the modal came back.

The fix

Remember which accounts have already been shown the modal, persisted and keyed by BitPay ID eid:

  • Replaced the non-persisted boolean kycGetVerifiedModalShown with kycGetVerifiedModalShownEids: string[], and removed it from the persist blacklist so it survives restarts. The transient "is the modal open right now" flag (showKycGetVerifiedModal) stays blacklisted.
  • The account's eid is recorded when the modal is shown (so a crash before you dismiss it can't re-prompt), and deduped.
  • On logout (RESET), we only hide the modal — the per-account list is kept, so signing back into the same account doesn't re-prompt. Same approach as the KYC home-banner ack.
  • setShowKycGetVerifiedModal(show, eid?) now takes the eid; HomeRoot gates the prompt on the current account's eid not already being in the list.

Why key by eid

So a different account that signs in later is never suppressed by a previous account's dismissal — each account gets the prompt exactly once. The eid is the stable, per-account BitPay ID.

Safety / migration

Existing users have no persisted list yet; autoMergeLevel2 backfills it from the new initialState as [], so there's no migration and no crash — .includes() always runs on an array.

Testing

  • Added reducer tests (appended to the existing app.reducer.spec.ts suite) covering: the blacklist change, per-eid recording, dedup, account independence, hide-leaves-list-intact, and that logout keeps the per-account memory.
  • Launched on the iOS simulator on this branch — boots cleanly to Home with no crash, confirming the new persisted field and selectors work on an existing install.

Note: a full before/after on-device repro of the modal itself needs an email-verified BitPay ID with KYC notStarted logged into the sim; happy to walk through it live if you want to see the behavior change directly.

Jira: RN-3112

The "Get Verified" KYC prompt on Home was reappearing every time the app
started (and on every Metro refresh in dev). The only thing suppressing a
repeat was an in-memory flag (kycGetVerifiedModalShown) that sat on the
redux-persist blacklist, so it reset to false on every launch. For any verified
user whose KYC is still "notStarted", the modal fired again ~1s after Home
focused, every single time.

Fix: remember which accounts have already been shown the modal, persisted and
keyed by BitPay ID eid.

- app reducer: replace the non-persisted boolean `kycGetVerifiedModalShown`
  with `kycGetVerifiedModalShownEids: string[]`, and drop it from the persist
  blacklist so it survives restarts. The eid is recorded when the modal is
  shown (so a crash before dismiss can't re-prompt), deduped.
- RESET (on logout) now only hides the modal; the per-account list is kept, so
  signing back into the same account doesn't re-prompt — same approach as the
  KYC banner ack.
- `setShowKycGetVerifiedModal` now takes `(show, eid?)`; its payload is
  `{show, eid}`.
- HomeRoot: gate the prompt on the current account's eid not being in the list,
  and pass that eid when showing.

Keying by eid is deliberate: a different account that signs in later is never
suppressed by a previous account's dismissal. Existing users with no persisted
list get `[]` via autoMergeLevel2, so there is no migration and no crash.

Adds reducer tests covering the blacklist change, per-eid recording, dedup,
account independence, and that logout keeps the per-account memory.
@JohnathanWhite JohnathanWhite changed the title Show the Get Verified modal once per account, not on every launch KYC: Fix - show the Get Verified modal once per account, not on every launch Oct 29, 2026

@cmgustavo cmgustavo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Heads up on the semantics once this is rebased onto develop: the eid is recorded when the modal is shown (app.reducer.ts, SET_SHOW_KYC_GET_VERIFIED_MODAL), not when the user dismisses it.

develop now has an effect in GetVerifiedModal that closes the modal automatically when canStartKyc flips to false while it is visible. With record-on-show, that auto-close would also mark the account as "already shown", even though the user never saw or dismissed it, and they would never get the prompt again.

Would it be better to record the eid in the user-driven dismiss paths (close button, backdrop, "Verify My Account") and leave the auto-close out? The crash-before-dismiss case you describe is the trade-off: recording on dismiss means a crash while the modal is open re-prompts once.

@cmgustavo

Copy link
Copy Markdown
Member

@JohnathanWhite heads up, I opened #2501 with the same fix, but it stores the dismissed eid under SUMSUB (next to bannerAck) instead of APP, and records it when the user dismisses the modal rather than when it is shown. We should pick one before merging so we don't end up with two mechanisms for the same thing.

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.

2 participants