Skip to content

[907] Frontend: Implement optimistic UI updates with rollback on transaction failure - #917

Merged
Junirezz merged 12 commits into
Junirezz:mainfrom
Max-Owolabi:fix/907-frontend-implement-optimistic-ui-updates-with-rollback-on-transaction-failure
Jul 29, 2026
Merged

[907] Frontend: Implement optimistic UI updates with rollback on transaction failure#917
Junirezz merged 12 commits into
Junirezz:mainfrom
Max-Owolabi:fix/907-frontend-implement-optimistic-ui-updates-with-rollback-on-transaction-failure

Conversation

@Max-Owolabi

Copy link
Copy Markdown
Contributor

Summary

  • Extract shared optimisticVaultCache helpers for snapshot, apply, and exact rollback of deposit/withdraw React Query caches
  • Fix withdrawal optimistic wallet balance direction (credit USDC) and reconcile via onSettled invalidation after success or failure
  • Expand unit tests for balance/holdings/TVL rollback and document the optimistic mutation pattern

Closes #907

Test plan

  • npm run test:run -- src/lib/optimisticVaultCache.test.ts src/hooks/useVaultMutations.test.tsx (18 passing)
  • npm run build in frontend/
  • CI frontend lint + test + build green

Extract shared optimistic cache helpers, fix withdraw wallet-credit
direction, restore exact pre-mutation snapshots on failure, and
reconcile via onSettled invalidation. Closes Junirezz#907.

Co-authored-by: Cursor <cursoragent@cursor.com>
@drips-wave

drips-wave Bot commented Jul 24, 2026

Copy link
Copy Markdown

@Max-Owolabi 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! 🚀

Learn more about application limits

Max-Owolabi and others added 11 commits July 24, 2026 09:45
Co-authored-by: Cursor <cursoragent@cursor.com>
Revert api-schemas tsconfig so contracts/backend CI are not triggered,
build schemas with TypeScript 5.5 in E2E/Cypress, stabilize docs on
share-price-math, and remove unused helpers that fail eslint.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Hoist vault mutation mocks, wrap WalletConnect with PreferencesProvider,
relax modal null assertion, fix monospace style check, remove duplicate
table bindings, and keep a single Cypress config file.

Co-authored-by: Cursor <cursoragent@cursor.com>
Disable address masking in Navbar/WalletConnect tests, assert is-error,
complete matchMedia stubs for VaultDashboard, and import preference helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use live timestamps for summary/fee quotes and wait for deferred confetti.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Seed per-wallet preference to unmask identifiers and accept truncated or
masked navbar address formats in deposit/portfolio E2E specs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Junirezz
Junirezz merged commit 793c2c6 into Junirezz:main Jul 29, 2026
4 of 5 checks passed
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.

Frontend: Implement optimistic UI updates with rollback on transaction failure

2 participants