Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in the authentication flow that could lock users out when their hash key expires. The bug occurred when signing in after hash key expiration: the signIn function would generate a hash key, but then createTemporaryStore would fail to fetch the old temporary store and call clearTemporaryData(), which deleted the newly created hash key.
Changes:
- Fixed hash key generation duplication by letting createTemporaryStore handle hash key generation with shouldRefreshHashKey: true
- Optimized initBiometricPassword to check biometric storage first before attempting to access the temporary store
- Added E2E test configuration flag to enable short (10 second) hash key expiration for testing
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/env.d.ts | Adds E2E_TEST_HASH_EXPIRATION environment variable type definition |
| src/helpers/isEnv.ts | Exports isE2ETestHashExpiration flag with clear documentation |
| src/config/constants.ts | Makes HASH_KEY_EXPIRATION_MS conditional (10s for E2E tests, 24h for production) |
| src/ducks/auth.ts | Fixes hash key duplication bug in signIn and improves initBiometricPassword to avoid temp store access when unnecessary |
| tests/ducks/auth.test.ts | Adds comprehensive test coverage for hash key expiration scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…llar/freighter-mobile into lf-fix-hash-key-refresh-after-expire
…x-hash-key-refresh-after-expire
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.
What
[TODO: Short statement about what is changing.]
Why
[TODO: Why this change is being made. Include any context required to understand the why.]
Known limitations
[TODO or N/A]
Checklist
PR structure
Testing
Release