Fix/milestone state machine - #1189
Open
onyekachi66 wants to merge 11 commits into
Open
onyekachi66 wants to merge 11 commits into
onyekachi66 wants to merge 11 commits into
Conversation
|
@onyekachi66 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
onyekachi66
force-pushed
the
fix/milestone-state-machine
branch
from
September 3, 2026 21:06
a2a2f4d to
3dd78aa
Compare
…ateVault, and FundReleaseStatus
…e during periodic refresh
… CreateVault mocks
…nd test isolation
…s test props, and WalletContext tests
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.
Closes #1152
Description
This PR addresses the production-quality risk area concerning milestone progress and fund-release state handling. By introducing a definitive local state machine, we enforce strict invariants across retries, page refreshes, and interrupted wallet operations, preventing contradictory client state from displaying impossible transitions.
Refs #
Acceptance Criteria Addressed
MilestoneTrackerandFundReleaseStatus, consuming validated server state and applying optimistic UI updates defensively. The inputs rely strictly on the vault context and authorized bounds.useVaultActionStoreleveraging Zustand. The explicitActionStatusmappings (idle | signing | submitting | success | error) map precisely to real on-chain operational phases.success), the UI immediately marks the milestone asvalidated(optimistically), preventing the user from clicking the action button again while the server or indexer is lagging.sessionStorage. If a timeout or server error occurs post-signature (duringsubmitting), the user is presented with a "Retry" prompt directly inline on the milestone. This retry bypasses thesigningphase, safeguarding against silently repeating an on-chain action or prompting unnecessary wallet signatures.MilestoneTrackerandFundReleaseStatusto simulate and assert optimistic UI state injections and deterministic conditional rendering of loading and error UI inline.Validation Commands
To validate the implementation and run tests, use:
Design Tradeoffs & Limitations
sessionStorage(via Zustand persist) for the UI action store to ensure that refreshes during long-running submissions preserve state. This means state will not survive a full browser tab close, which is a conscious tradeoff to prevent endless zombie states since we cannot indefinitely poll the indexer without an active session context.VaultDetailintegration tests expect the "Validate Milestone" button to reside at the header layout instead of within the<MilestoneTracker>elements, those DOM locators might need a minor selector update in subsequent QA passes.