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(web): Stop fetching context data on window focus #5568

Closed
wants to merge 2 commits into from

Conversation

SokratisVidros
Copy link
Contributor

What changed? Why was the change needed?

Every time the window gets focused, six requests are triggered to fetch orgs, users, changes, subscriptions, etc...

Screenshots

<img width="624" alt="Screenshot 2024-05-14 at 18 37 02" src="https://github.com/novuhq/novu/assets/1352422/64260d02-622a-4910-b3e9-0e3a6584f500"

@SokratisVidros SokratisVidros self-assigned this May 14, 2024
Copy link

netlify bot commented May 14, 2024

Deploy Preview for novu-design failed. Why did it fail? →

Name Link
🔨 Latest commit 274adf7
🔍 Latest deploy log https://app.netlify.com/sites/novu-design/deploys/66719868971de500089e48d3

Copy link

netlify bot commented May 14, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 274adf7
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/667198687990f50008a6ec4b
😎 Deploy Preview https://deploy-preview-5568--dev-web-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Everytime the window gets focus, six requests are triggered to fetch orgs, users, changes, subscriptions, etc...
@@ -20,7 +20,6 @@ const queryClient = new QueryClient({
queries: {
queryFn: defaultQueryFn as any,
refetchOnWindowFocus: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Refetch on window focus is already disabled on this line, it’s not clear what this change is achieving by removing the retry option. Could you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please ignore. This change was pushed as part of the PW migration.

@SokratisVidros SokratisVidros deleted the do_not_refresh_on_focus branch June 18, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants