-
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
feat(native-app): add barcode session error #17623
Conversation
WalkthroughThis pull request introduces enhanced error handling for wallet pass functionality across multiple files. The changes focus on improving session-related error management by adding new localized error messages for bad session scenarios and modifying the error handling logic in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (1)apps/native/app/src/ui/lib/card/license-card.tsx (1)Pattern
🔇 Additional comments (4)
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17623 +/- ##
=======================================
Coverage 35.56% 35.56%
=======================================
Files 7033 7033
Lines 150624 150626 +2
Branches 43023 43021 -2
=======================================
+ Hits 53562 53564 +2
Misses 97062 97062 Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 8 Total Test Services: 0 Failed, 7 Passed Test Services
🔻 Code Coverage Decreases vs Default Branch (1)
|
c9e79a7
to
89bd79e
Compare
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.
LGTM 👍
Datadog ReportAll test runs ✅ 10 Total Test Services: 0 Failed, 10 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (11)
|
89bd79e
to
e8f6769
Compare
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
🧹 Nitpick comments (1)
apps/native/app/src/ui/lib/card/license-card.tsx (1)
Line range hint
1-319
: Consider extracting error handling logic into a custom hook.While the implementation is solid, consider extracting the error handling logic into a custom hook (e.g.,
useLicenseError
) to improve reusability and maintain separation of concerns.This would:
- Make the error handling logic reusable across components
- Simplify testing
- Keep the component focused on rendering
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/native/app/src/messages/en.ts
(1 hunks)apps/native/app/src/messages/is.ts
(1 hunks)apps/native/app/src/screens/wallet-pass/wallet-pass.tsx
(1 hunks)apps/native/app/src/ui/lib/card/license-card.tsx
(5 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/native/app/src/messages/en.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/native/app/src/screens/wallet-pass/wallet-pass.tsx
- apps/native/app/src/messages/is.ts
🧰 Additional context used
📓 Path-based instructions (1)
apps/native/app/src/ui/lib/card/license-card.tsx (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."
🔇 Additional comments (2)
apps/native/app/src/ui/lib/card/license-card.tsx (2)
309-311
: LGTM! Clear and well-structured error message selection.The conditional logic for selecting error messages is clean and follows best practices.
11-11
: Breaking change: Update error prop type from boolean to ApolloError.The change in the error prop type from boolean to ApolloError is a breaking change that will require updates in parent components passing the error prop to LicenseCard.
Let's verify the impact on parent components:
Also applies to: 26-29, 130-130
What
If I get
BAD_SESSION
error when fetching a barcode I show an error message that states that it is too short since license was accessed on another device. Need to merge #17541 before this.Screenshots / Gifs
(The spacing below the picture has already been fixed)
Checklist:
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Localization
This update enhances the user experience by providing clearer guidance during potential session-related issues when accessing licenses from multiple devices.