Skip to content

Add transaction-state persistence across reloads to TransactionProgressModal#1195

Open
greatest0fallt1me wants to merge 1 commit into
Commitlabs-Org:masterfrom
greatest0fallt1me:fix/issue-950
Open

Add transaction-state persistence across reloads to TransactionProgressModal#1195
greatest0fallt1me wants to merge 1 commit into
Commitlabs-Org:masterfrom
greatest0fallt1me:fix/issue-950

Conversation

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Fixes #950

Summary

  • Introduces useTransactionPersistence hook that persists in-flight transaction state (step, hash, errorCode, actionName) to localStorage on each state change
  • TransactionProgressModal rehydrates persisted state on mount and re-opens at the correct step after a page reload, preserving copy-hash and retry affordances
  • Terminal states (SUCCESS/IDLE) and explicit user close actions clear the stored entry; storage errors are swallowed for a safe no-op when localStorage is unavailable

Changes

  • src/hooks/useTransactionPersistence.ts — new hook with versioned schema, 30-min TTL, and safe storage access
  • src/app/TransactionProgressModal.tsx — integrates persistence hook; uses effective state derived from live props or rehydrated fallback
  • src/app/TransactionModalPersist.test.tsx — tests covering reload re-open, hash preservation, terminal-state cleanup, storage-unavailable no-op, live-props precedence, and idle/empty render
  • docs/TRANSACTION_PERSIST.md — feature documentation with API reference, accessibility notes, and usage example

…ProgressModal

Introduces useTransactionPersistence hook that writes in-flight transaction
state (step, hash, errorCode, actionName) to localStorage on each state change
and rehydrates it on mount so the modal re-opens at the correct step after a
page reload. Terminal states (SUCCESS/IDLE) and explicit user close actions
clear the stored entry. Storage errors are swallowed to ensure a safe no-op
when localStorage is unavailable. Adds focused tests and docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@greatest0fallt1me is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Add transaction-state persistence across reloads to TransactionProgressModal

1 participant