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

Enable retries in react-query #56

Conversation

yivlad
Copy link
Contributor

@yivlad yivlad commented May 27, 2024

  • Sets number of retries for queries in react-query to 3
  • Sets the base delay between retry attempts to 150ms.
  • Removes duplicate createSandboxConnector function.

Copy link

vercel bot commented May 27, 2024

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

Name Status Preview Comments Updated (UTC)
spark-app-production ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 10:49am
spark-app-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 10:49am

@yivlad yivlad force-pushed the fro-650-investigate-why-refresh-didnt-work-after-coming-back-to-the branch from d9925ec to d942916 Compare May 27, 2024 16:08
Copy link

github-actions bot commented May 27, 2024

📦 Size Report

Path Size Diff
JS 1.19 MB -6 B (-0.01% 🔽)
CSS 14.88 KB 0 B (0%)

Copy link

github-actions bot commented May 27, 2024

🖼️ Visual Regression Report for e2e

🟨 Visual changes detected. Please review the report!

Status Count
Changed 3

This report was generated by comparing 00b328d with baf1a77.Compare.

@@ -7,7 +7,8 @@ export const queryClient = new QueryClient({
queries: {
gcTime: 1_000 * 60 * 60 * 24, // 24 hours
refetchOnWindowFocus: true,
retry: 0,
retry: 3,
retryDelay: (attemptIndex) => Math.min(150 * 2 ** attemptIndex, 10_000), // reduce the base delay to 150ms
Copy link
Contributor

Choose a reason for hiding this comment

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

Why Math.min? it will be always below 10s with 3 retries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just in case someone overrides the retry prop

@yivlad yivlad merged commit 5b89435 into main May 29, 2024
9 checks passed
@yivlad yivlad deleted the fro-650-investigate-why-refresh-didnt-work-after-coming-back-to-the branch May 29, 2024 11:49
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.

3 participants