Improve PIN validation and query cache handling#1632
Merged
MusabShakeel576 merged 3 commits intoqafrom Mar 12, 2026
Merged
Conversation
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
- 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
…parseUnits" This reverts commit e24c256.
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.
Summary
This PR improves PIN validation logic and updates query cache configuration in the ManagePinForm component.
Key Changes
isSimpleSequence()to detect both ascending and descending digit sequences (e.g., "1234" and "4321" are now both considered simple sequences)gcTime: 0andstaleTime: 0to the useQuery configuration to ensure fresh data is always fetched and cache is not retainedImplementation Details
isSimpleSequence()function now tracks both ascending and descending patterns separately, returning true if either pattern is detectedhttps://claude.ai/code/session_01W66wRpe8pxFbdrgLi7PVFi