-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(native-app): offline mode more fixes #15246
Conversation
WalkthroughThe recent changes improved state persistence and streamlined app lock screen management. State persistence was implemented for user authentication in the Changes
Sequence Diagram(s)Auth Store with PersistencesequenceDiagram
actor User
User->>AuthStore: Performs login/logout
AuthStore->>PersistMiddleware: Save state to AsyncStorage
PersistMiddleware-->>AuthStore: State saved
AuthStore->>User: Token refreshed, User Info updated
Hide App Lock OverlaysequenceDiagram
participant App
participant LockOverlay
App->>LockOverlay: Request to hide with lockScreenComponentId
alt lockScreenActivatedAt is not null
LockOverlay-->>App: Dismiss specific lock screen
else
LockOverlay-->>App: Update with status
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- apps/native/app/src/stores/auth-store.ts (3 hunks)
- apps/native/app/src/utils/app-lock.ts (1 hunks)
- apps/native/app/src/utils/lifecycle/setup-event-handlers.ts (1 hunks)
Additional context used
Path-based instructions (3)
apps/native/app/src/utils/app-lock.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/utils/lifecycle/setup-event-handlers.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/stores/auth-store.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
Biome
apps/native/app/src/stores/auth-store.ts
[error] 102-107: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)
Unsafe fix: Omit the else clause.
Additional comments not posted (2)
apps/native/app/src/utils/app-lock.ts (1)
58-64
: The updatedhideAppLockOverlay
function now correctly handles the dismissal of the lock screen overlay and resets the relevant states. Good integration with theauthStore
state management.apps/native/app/src/utils/lifecycle/setup-event-handlers.ts (1)
129-132
: The logic to handle app lock based on the timeout and app state is well-implemented. It ensures that the app lock overlay is managed correctly across different app states.
Datadog ReportAll test runs ✅ 13 Total Test Services: 0 Failed, 13 Passed Test ServicesThis report shows up to 10 services
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15246 +/- ##
==========================================
- Coverage 37.10% 37.10% -0.01%
==========================================
Files 6448 6448
Lines 131454 131446 -8
Branches 37574 37566 -8
==========================================
- Hits 48780 48776 -4
+ Misses 82674 82670 -4
Flags with carried forward coverage won't be shown. Click here to find out more. see 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome nice catch on the dismiss overlay 😅
What
I tried to only persist userInfo.name and userInfo.nationalId but did not find a proper way to do it (zustand whitelist only accepts keys of the store).
This is the info that is stored:
Is something of this too delicate to persist? E.g. the sub? @eirikurn
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
lockScreenActivatedAt
parameter, ensuring it is set tonull
properly.Refactor
setupEventHandlers()
to improve app lock screen behavior based onlockScreenActivatedAt
status.