Skip to content
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: plus gifter query error makes page slow #4179

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ilasw
Copy link
Contributor

@ilasw ilasw commented Feb 12, 2025

Changes

  • API return error if you have no gifterId (this endpoint wasn't designed for /plus page) so we need to remove the default retry that will slow the initial loading of this page for already plus users;
    • Also changed this behaviour in modal even if this should not happen there
  • Convert function in useMemo in order to reduce re-renders on paddle's container

Events

Did you introduce any new tracking events?

Experiment

Did you introduce any new experiments?

Manual Testing

Caution

Please make sure existing components are not breaking/affected by this PR

Preview domain

https://fix-plus-checkout-loading.preview.app.daily.dev

Copy link

vercel bot commented Feb 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview Feb 12, 2025 2:48pm
1 Skipped Deployment
Name Status Preview Updated (UTC)
storybook ⬜️ Ignored (Inspect) Feb 12, 2025 2:48pm

@@ -31,6 +31,7 @@ export const PlusPlus = ({ className }: PlusPlusProps): ReactElement => {
queryFn: getPlusGifterUser,
enabled: Boolean(user?.isPlus),
staleTime: StaleTime.Default,
retry: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should disable retry but handle the error inside getPlusGifterUser, for example if ForbiddenError('User is not a gifted plus user') we catch it and return false from getPlusGifterUser

Copy link
Contributor

Choose a reason for hiding this comment

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

you can check how to catch API error in useSourceIntegrationQuery

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice! Added retry again and moved with this solution ✔️

@ilasw ilasw requested a review from capJavert February 12, 2025 14:58
@ilasw ilasw changed the title fix: disable retry for plus gifter query fix: plus gifter query error makes page slow Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants