Skip to content

Simplify banner scope to asset and wallet id - #986

Merged
DRadmir merged 3 commits into
mainfrom
wt2/banner-drop-chain
Aug 28, 2026
Merged

Simplify banner scope to asset and wallet id#986
DRadmir merged 3 commits into
mainfrom
wt2/banner-drop-chain

Conversation

@DRadmir

@DRadmir DRadmir commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

A banner was carrying both an asset and a chain, and a whole wallet where only its id was ever used.

The chain is already part of the asset, so banners scoped to a network now use that network's own asset. This also fixes the multi-signature warning on Android, which showed an empty network name.

The wallet is now just a wallet id. Together this removes a database column, both joins from the banner query, and a hand-written decoder that only existed to work around a name clash.

@DRadmir
DRadmir marked this pull request as draft August 27, 2026 08:48
@DRadmir DRadmir self-assigned this Aug 27, 2026
@DRadmir
DRadmir force-pushed the wt2/banner-drop-chain branch 2 times, most recently from b2d165e to 93979b9 Compare August 27, 2026 10:29
An AssetId already carries the chain, so a banner scoped to a chain is
expressible as the chain's native asset. Multi-signature banners now carry
that asset instead of a separate chain, which also fills the chain name in
the Android warning text that rendered empty.

Banner.wallet held a whole Wallet so that two call sites could read its id
and its nil-ness; it becomes a WalletId. Together this drops both joins
from the banner query, removes the chain column whose name collided with
the association key and forced a hand-written row decoder, and lets
NewBanner stop fabricating a Wallet just to read its id back.
The enable-notifications banner was unreachable on both platforms: iOS
never called active_events and Android required no wallet at all, so no
row for it has ever been written. The system prompt shown right after
wallet creation covers the case, so the event goes away entirely, and
with it is_available, closes_on_action, which then always returned false,
and the notification permissions the banner service held only for it.

That leaves active_events producing nothing the seed and extra_banners do
not already provide, so both platforms now read banners the same way:
rows from the database filtered by visible_banners. Android drops its
generate-and-merge branch. This also fixes a banner needing two closes
there: the generator looked up a wallet-scoped key while the seed and the
close wrote a global one, so the first close was never seen.
@DRadmir
DRadmir force-pushed the wt2/banner-drop-chain branch from 93979b9 to 1de52ee Compare August 28, 2026 06:14
@DRadmir
DRadmir marked this pull request as ready for review August 28, 2026 06:23
@DRadmir
DRadmir merged commit 4688931 into main Aug 28, 2026
7 checks passed
@DRadmir
DRadmir deleted the wt2/banner-drop-chain branch August 28, 2026 08:25
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