Skip to content

fix: do not swallow error in fetchData#13058

Closed
longlho wants to merge 1 commit into
nextauthjs:mainfrom
longlho:main
Closed

fix: do not swallow error in fetchData#13058
longlho wants to merge 1 commit into
nextauthjs:mainfrom
longlho:main

Conversation

@longlho

@longlho longlho commented Jun 19, 2025

Copy link
Copy Markdown

☕️ Reasoning

fetchData currently swallows error, which makes network error returns null and is equivalent to a user becoming unauthenticated. I don't think that's ideal since a network blip can log a person out, especially in combination with refetchInterval this has unintentional side effects.
Downside is this makes session a bit stale.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

@longlho longlho requested a review from ThangHuuVu as a code owner June 19, 2025 02:43
@vercel

vercel Bot commented Jun 19, 2025

Copy link
Copy Markdown

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

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2025 2:49am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Jun 19, 2025 2:49am

@vercel

vercel Bot commented Jun 19, 2025

Copy link
Copy Markdown

@longlho is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@ThangHuuVu

Copy link
Copy Markdown
Contributor

This would introduce a breaking change, for codes that rely on fetchData returning null on error.
I would recommend you write your own client fetching for now, as the resource to maintain the library is limited and we don't want to deal with potential breaking changes, sorry for the inconvenience!

@ThangHuuVu ThangHuuVu closed this Jun 22, 2025
@longlho

longlho commented Jun 22, 2025

Copy link
Copy Markdown
Author

Understood. How do I override client fetching for next-auth provider?

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