Skip to content

[QA 1.11] refresh hash after expire#730

Closed
leofelix077 wants to merge 20 commits intomainfrom
lf-fix-hash-key-refresh-after-expire
Closed

[QA 1.11] refresh hash after expire#730
leofelix077 wants to merge 20 commits intomainfrom
lf-fix-hash-key-refresh-after-expire

Conversation

@leofelix077
Copy link
Collaborator

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

  • This PR does not mix refactoring changes with feature changes (break it down into smaller PRs if not).
  • This PR has reasonably narrow scope (break it down into smaller PRs if not).
  • This PR includes relevant before and after screenshots/videos highlighting these changes.
  • I took the time to review my own PR.

Testing

  • These changes have been tested and confirmed to work as intended on Android.
  • These changes have been tested and confirmed to work as intended on iOS.
  • These changes have been tested and confirmed to work as intended on small iOS screens.
  • These changes have been tested and confirmed to work as intended on small Android screens.
  • I have tried to break these changes while extensively testing them.
  • This PR adds tests for the new functionality or fixes.

Release

  • This is not a breaking change.
  • This PR updates existing JSDocs when applicable.
  • This PR adds JSDocs to new functionalities.
  • I've checked with the product team if we should add metrics to these changes.
  • I've shared relevant before and after screenshots/videos highlighting these changes with the design team and they've approved the changes.

@leofelix077 leofelix077 self-assigned this Feb 20, 2026
Copilot AI review requested due to automatic review settings February 20, 2026 15:52
@leofelix077 leofelix077 added wip work in progress don't review yet Work in Progress / Draft PR / Code Review adjustments being worked on labels Feb 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

don't review yet Work in Progress / Draft PR / Code Review adjustments being worked on wip work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants