fix(ui): Platform Sync Clear actually forces a full trunk/branch resync#840
Merged
QuantumExplorer merged 1 commit intoJul 17, 2026
Merged
Conversation
The Sync Info screen's Clear button only called clearDisplay() — a published-counter wipe. The Rust-owned incremental-sync watermark survived, so the next Sync Now resumed from the checkpoint (Recent queries only) while the zeroed UI implied a from-scratch rescan that never happened. Clear now runs the SwiftExampleApp clearLocalState contract: 1. resetPlatformAddressSyncState() first (fail closed — on error the display keeps its real state instead of showing a false "cleared"), 2. zero the network's PersistentPlatformAddress volatile fields in place (rows are durable derivation state the rescan upserts against — deleting them would strand balances until relaunch), 3. delete the PersistentPlatformAddressesSyncState watermark rows, 4. clear the display and re-arm the background loop the Rust reset deliberately leaves stopped. Sync Now / Clear gate on the new isClearing flag for the duration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Problem
On the Platform Sync Status screen, Clear + Sync Now looked like a from-scratch resync but wasn't one: Clear only called
clearDisplay()(a published-counter wipe). The Rust-owned BLAST incremental-sync watermark survived, so the next Sync Now resumed from the checkpoint — Recent queries only, no trunk/branch walk — under a zeroed UI that implied a full rescan. Exactly the "I feel like it isn't really resyncing" QA observation.Fix
PlatformAddressSyncCoordinator.clearLocalState(), ported from the SwiftExampleAppPlatformBalanceSyncServicecontract:resetPlatformAddressSyncState()first — drains the in-flight pass and drops the Rust watermark, which is what actually forces the full trunk/branch rescan. Fail closed: on error the display keeps its real state rather than showing a false "cleared".PersistentPlatformAddressvolatile fields — the rows are durable derivation state the rescan upserts against; deleting them would strand balances until an app relaunch re-seeds them.PersistentPlatformAddressesSyncStatewatermark rows — pure volatile state, recreated by the next sync.The screen's Clear button now runs this sequence; Sync Now / Clear are gated on the new
isClearingflag for its duration.Test plan
🤖 Generated with Claude Code