Skip to content

fix(tokens): resolve token via tokenCoordinator when stateFlow race loses#1018

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/race-phantom-confirm
Jun 30, 2026
Merged

fix(tokens): resolve token via tokenCoordinator when stateFlow race loses#1018
bmc08gt merged 1 commit into
code/cashfrom
fix/race-phantom-confirm

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

The ConfirmPhantomTransaction and Coinbase purchase handlers read stateFlow.value.tokenWithBalance?.token synchronously. After the amount-entry refactor the async combine flow that populates tokenWithBalance can lose the race, leaving the snapshot null.

Extract resolveToken() that falls back to
tokenCoordinator.getTokenMetadata(mint) (memory -> Room -> network) when the flow hasn't delivered yet.

Also bumps phantom-connect-kmp 2.0.2-1.0.0 -> 2.0.2-1.0.1.

…oses

The ConfirmPhantomTransaction and Coinbase purchase handlers read
stateFlow.value.tokenWithBalance?.token synchronously. After the
amount-entry refactor the async combine flow that populates
tokenWithBalance can lose the race, leaving the snapshot null.

Extract resolveToken() that falls back to
tokenCoordinator.getTokenMetadata(mint) (memory -> Room -> network)
when the flow hasn't delivered yet.

Also bumps phantom-connect-kmp 2.0.2-1.0.0 -> 2.0.2-1.0.1.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
@bmc08gt bmc08gt self-assigned this Jun 30, 2026
@github-actions github-actions Bot added type: fix Bug fix area: build-system Gradle, convention plugins, build-logic area: tokens Token accounts, balances, token info labels Jun 30, 2026
@bmc08gt bmc08gt merged commit d03434a into code/cash Jun 30, 2026
3 checks passed
@bmc08gt bmc08gt deleted the fix/race-phantom-confirm branch June 30, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic area: tokens Token accounts, balances, token info type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant