fix: fail closed on USDT0 banner dismissal lookup, announce the dialog - #2999
Merged
Conversation
Addresses the review comments left on #2990 after it merged. A failed dismissal lookup resolved to "not dismissed", so a transient messaging failure re-showed the promo to someone who had already dismissed it. Propagate the error from the shared helper (matching getHasSeenDiscoverWelcome) and let the component's catch make the fail-closed choice, as useDiscoverWelcome already documents. Also drop the redundant read-back after the dismissal write — the analogous dismissDiscoverWelcome handler returns true straight after setItem, and re-reading only adds a second failure point — and mark the banner's launch button with aria-haspopup/aria-expanded so assistive tech announces that it opens a dialog, mirroring AddCollectibles. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Makes the USDT0 promotion fail closed on dismissal lookup errors and improves dialog accessibility.
Changes:
- Hides the banner when dismissal lookup fails.
- Removes the redundant post-write read.
- Announces the launch sheet as a dialog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
@shared/api/internal.ts |
Propagates structured lookup errors. |
dismissUsdt0LaunchBanner.ts |
Returns success after storage completes. |
Usdt0LaunchBanner/index.tsx |
Fails closed and adds dialog ARIA state. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-295b5792cd8c177f0063 |
CassioMG
added a commit
that referenced
this pull request
Sep 3, 2026
…rt) (#2997) * feat: add USDT0 launch banner and promo sheet to Home (v5.48.0) Backport of #2990 onto the v5.48.0 release branch so the promo can ship with that release. Applied as a single squashed commit; the tree for the 17 touched files is identical to the master-based branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: fail closed on USDT0 banner dismissal lookup, announce the dialog Backport of #2999 onto the v5.48.0 release branch, addressing the review comments left on #2990 after it merged. The three touched files match the master-based fix branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
CassioMG
added a commit
that referenced
this pull request
Sep 3, 2026
* v5.48.0 * fix(icons): show USDT0's icon, for new and existing users (v5.48.0) (#2998) Backport of #2994 onto the v5.48.0 release branch. Cherry-picked from bbcd41d; the four touched files are byte-identical to master. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * feat: add USDT0 launch banner and promo sheet to Home (v5.48.0 backport) (#2997) * feat: add USDT0 launch banner and promo sheet to Home (v5.48.0) Backport of #2990 onto the v5.48.0 release branch so the promo can ship with that release. Applied as a single squashed commit; the tree for the 17 touched files is identical to the master-based branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: fail closed on USDT0 banner dismissal lookup, announce the dialog Backport of #2999 onto the v5.48.0 release branch, addressing the review comments left on #2990 after it merged. The three touched files match the master-based fix branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Follow-up to #2990, which merged before its last review comments were addressed. Three small fixes to the USDT0 launch banner:
No user-visible change in the normal path.
Implementation details (for agents)
Fail closed on unknown dismissal state (
@shared/api/internal.ts,Usdt0LaunchBanner/index.tsx):getUsdt0LaunchBannerDismissednow throws on a structurederrorinstead of returningfalse, matchinggetHasSeenDiscoverWelcome; the component'scatchsetsisDismissedtotrueand keeps reporting to Sentry, with the same rationale commentuseDiscoverWelcome.tscarries. That leaves one place deciding the default, so the helper's branch can't later disagree with the catch. Note the helper'sif (error)branch is latent today —popupMessageListenerreturns{ isDismissed }and never a structured{ error }— so the live path this fixes is the component'scatchwhenlocalStore.getItemrejects inside the handler and the rejection propagates out throughbrowser.runtime.sendMessage.Drop the read-back (
handlers/dismissUsdt0LaunchBanner.ts): return{ isDismissed: true }immediately aftersetItem, asdismissDiscoverWelcomedoes. Previously a successful write followed by a failed read reportedfalse, leaving the banner up for that popup session even though the dismissal had persisted.Dialog semantics (
Usdt0LaunchBanner/index.tsx):aria-haspopup="dialog"+aria-expanded={isSheetOpen}on the launch button. The sheet is opened by local state and its Radix Root is a sibling of the button, soSheetTriggercan't reach it — the same constraint asAddCollectibles/index.tsx:212-226, whose comment and attribute pair this mirrors.aria-controlsis omitted because the dialog id is generated inside the portal.Verification:
yarn build:extensionclean;yarn test:ci1772 passed, 1 failed — the failure isremoteConfig.test.ts"defaults use_balances_v2 to true", caused by an unrelated local working-tree edit, not by this change and not part of this PR.Backport: the same three fixes are applied to #2997 (the v5.48.0 backport of #2990).
🤖 Generated with Claude Code