Skip to content

Fix: State race condition and clean refactor#26

Open
akbarsaputrait wants to merge 6 commits intomasterfrom
fix/race-condition-state
Open

Fix: State race condition and clean refactor#26
akbarsaputrait wants to merge 6 commits intomasterfrom
fix/race-condition-state

Conversation

@akbarsaputrait
Copy link
Member

Overview

Fixes critical payment state race conditions and adds comprehensive documentation.

Key Fixes

1. Payment State Race Condition

Files: usePaymentState.ts, paymentEffects.ts

Added request ID tracking to prevent stale state updates during payment transitions and cross-chain switches.

// Validates request ID before applying updates
if (currentRequestId !== requestIdRef.current) return;

2. Stellar Wallet Duplicate Prompts

Files: StellarContextProvider.tsx, ConnectStellar/index.tsx
Fixed double wallet connection prompts by adding connection state tracking and lifecycle checks.

3. Modal Z-Index Issues

Files: Modal/index.tsx, Modal/styles.ts
Improved WalletConnect overlay stacking and button transition animations.

4. Code Cleanup

Removed unused utilities

  • useGoogleFont.tsx, useLocalStorage.ts, useModal.ts
  • p3.ts, supportUrl.ts, validatePayoutToken.ts

5. Documentation Added

  • docs/ARCHITECTURE.md - FSM, multi-chain architecture, payment flows
  • docs/TROUBLESHOOTING.md - 30+ issues with solutions
  • docs/QUICK_REFERENCE.md - State transitions, hook patterns
  • docs/STELLAR_EXTERNAL_KIT_AND_CONNECT.md - Stellar integration guide
  • docs/README.md - Documentation index
  • Enhanced CLAUDE.md - Added "Critical Insights for AI Assistants" section

…n, including critical insights for AI assistants and common pitfalls to avoid
…ment with request ID tracking to prevent stale updates
…ction management to prevent duplicate prompts
…ion documentation, and streamline package scripts
@vercel
Copy link

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
intent-example Ready Ready Preview, Comment Feb 3, 2026 3:14pm

Request Review

… analysis, and update dependencies for improved payment handling
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.

1 participant