Skip to content

Improve PIN validation and query cache handling#1632

Merged
MusabShakeel576 merged 3 commits intoqafrom
claude/review-rain-card-integration-2soPd
Mar 12, 2026
Merged

Improve PIN validation and query cache handling#1632
MusabShakeel576 merged 3 commits intoqafrom
claude/review-rain-card-integration-2soPd

Conversation

@MusabShakeel576
Copy link
Copy Markdown
Contributor

Summary

This PR improves PIN validation logic and updates query cache configuration in the ManagePinForm component.

Key Changes

  • Enhanced simple sequence detection: Modified isSimpleSequence() to detect both ascending and descending digit sequences (e.g., "1234" and "4321" are now both considered simple sequences)
  • Query cache optimization: Added gcTime: 0 and staleTime: 0 to the useQuery configuration to ensure fresh data is always fetched and cache is not retained

Implementation Details

  • The isSimpleSequence() function now tracks both ascending and descending patterns separately, returning true if either pattern is detected
  • This prevents users from setting PINs with simple descending sequences, improving security validation consistency
  • The query cache settings ensure that PIN-related queries don't serve stale data and are immediately garbage collected after use

https://claude.ai/code/session_01W66wRpe8pxFbdrgLi7PVFi

- Fix isSimpleSequence to also reject descending sequences (e.g. 4321)
- Set gcTime: 0 and staleTime: 0 on PIN query to prevent decrypted PIN
  from persisting in React Query cache after component unmount

https://claude.ai/code/session_01W66wRpe8pxFbdrgLi7PVFi
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 11, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored Preview Mar 11, 2026 3:13pm
solid-app-staging Ignored Ignored Preview Mar 11, 2026 3:13pm

Request Review

claude added 2 commits March 11, 2026 14:49
- Change store amount types from number to string to avoid float precision loss
- Replace Math.round(parseFloat * 10^6) with viem parseUnits for collateral withdrawal
- Use formatUnits consistently for balance conversions instead of manual division
- Add MAX_DECIMAL_PLACES_REGEX validation (max 6 decimals) to all deposit/withdraw forms
- Update TransactionStatus component to accept string | number for amounts
- Remove all Number(data.amount) conversions when setting transaction state

https://claude.ai/code/session_01W66wRpe8pxFbdrgLi7PVFi
@MusabShakeel576 MusabShakeel576 merged commit 0b87e1b into qa Mar 12, 2026
5 checks passed
@MusabShakeel576 MusabShakeel576 deleted the claude/review-rain-card-integration-2soPd branch March 12, 2026 08:48
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.

2 participants