-
Notifications
You must be signed in to change notification settings - Fork 13
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: enable user synchronization on upgrade prompt #2577
Conversation
Enables user synchronization in the upgrade prompt component by uncommenting the syncCurrentUser method. This ensures that the current user's data is properly synchronized when the component is inserted, improving the accuracy of user-related information displayed on the course page.
WalkthroughThe pull request modifies the Changes
Sequence DiagramsequenceDiagram
participant Component as UpgradePromptComponent
participant Authenticator as AuthenticatorService
Component->>Authenticator: syncCurrentUser()
Authenticator-->>Component: User synchronized
Possibly related PRs
Poem
✨ Finishing Touches
🪧 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
CodeRabbit Configuration File (
|
Test Results 1 files 1 suites 5m 50s ⏱️ Results for commit 619dea9. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files📢 Thoughts on this report? Let us know! |
Bundle ReportChanges will increase total bundle size by 36.07MB (100.0%) ⬆️
|
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: 0
🧹 Nitpick comments (1)
app/components/course-page/upgrade-prompt.ts (1)
102-105
: Consider adding error handling.Both
fetchCurrent()
andsyncCurrentUser()
are external calls that could fail. Consider wrapping these in a try-catch block to gracefully handle failures.@action @waitFor async handleDidInsert(): Promise<void> { - this.regionalDiscount = await this.store.createRecord('regional-discount').fetchCurrent(); - await this.authenticator.syncCurrentUser(); - this.isLoadingDiscounts = false; + try { + this.regionalDiscount = await this.store.createRecord('regional-discount').fetchCurrent(); + await this.authenticator.syncCurrentUser(); + this.isLoadingDiscounts = false; + } catch (error) { + console.error('Failed to initialize upgrade prompt:', error); + this.isLoadingDiscounts = false; + } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/components/course-page/upgrade-prompt.ts
(1 hunks)
🔇 Additional comments (1)
app/components/course-page/upgrade-prompt.ts (1)
104-104
: LGTM! Important synchronization fix.Uncommenting this line ensures that user data (including discount information) is fresh when the upgrade prompt is displayed, preventing potential display of stale or incorrect pricing information.
Enables user synchronization in the upgrade prompt component
by uncommenting the syncCurrentUser method. This ensures that
the current user's data is properly synchronized when the
component is inserted, improving the accuracy of user-related
information displayed on the course page.
Summary by CodeRabbit