fix(coins): resolve metadata race during concurrent coin activations#3454
Merged
fix(coins): resolve metadata race during concurrent coin activations#3454
Conversation
Points to GLEECBTC/komodo-defi-sdk-flutter#328 which adds mutex-protected atomic metadata updates to prevent concurrent coin activations from overwriting each other's state.
Batch-write all asset IDs to wallet metadata in a single call before launching parallel activations, then pass addToWalletMetadata: false to avoid N concurrent read-modify-write cycles that caused last-write-wins data loss. Migrate addActivatedCoins/removeActivatedCoins to use the new updateActiveUserKeyValue API for atomic single-key transforms.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Includes fix(auth): add mutex-protected atomic metadata updates (#328).
|
Visit the preview URL for this PR (updated for commit 47fac14): https://walletrc--pull-3454-merge-w78t3405.web.app (expires Mon, 30 Mar 2026 13:17:18 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
Resolve conflict in kdf_auth_metadata_extension.dart by keeping the atomic updateActiveUserKeyValue calls (race condition fix) over the non-atomic setOrRemoveActiveUserKeyValue from dev. SDK submodule fast-forwarded to 317719d which includes both #328 (mutex-protected metadata updates) and #329 (reified generics in JSON traversal for WASM/minified builds).
Points to fix/trezor-test-missing-method (ea99ec6) which adds the missing updateActiveUserMetadataKey stub to _FakeAuthService in trezor_auth_service_test.dart.
Points sdk at 869dd00 (komodo-defi-sdk-flutter dev), including PR #331.
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.
Summary
updateActiveUserMetadataKeyfor atomic read-modify-write cycles on user metadata.addToWalletMetadata: falseto avoid N concurrent writes that caused last-write-wins data loss.addActivatedCoins/removeActivatedCoinsto use the newupdateActiveUserKeyValueAPI for atomic single-key transforms.Test plan