fetch icon indicating copy to clipboard operation
fetch copied to clipboard

vercel/fetch returns 404 for calls that were returning 200 prior

Open sanjay-io opened this issue 2 years ago • 2 comments

Found this bug while working with https://github.com/transitive-bullshit/react-static-tweets/issues/43 and posted a gnarly post-install work-around over there.

The issue happens when doing a GET call on some endpoints, mine specifically being https://syndication.twitter.com/tweets.json?ids=296658470705438720.

I've confirmed with local calls in a (very friendly) loop to https://syndication.twitter.com/tweets.json?ids=296658470705438720 that that endpoint isn't intermittently returning 404. Actually, on the application instance, once a single 404 is returned it continues to return 404s which might indicate a state-related issue within vercel/fetch.

This is the line that causes the issue 404 in the aforementioned repo: https://github.com/transitive-bullshit/react-static-tweets/blob/4ff2e4e6eb138c3a98f364beb0117f0e2d5acc90/packages/static-tweets/src/twitter/api.ts#L16

I'll post more information / PR if I find anything helpful.

sanjay-io avatar Jun 05 '22 20:06 sanjay-io

I'm seeing the same behavior with node-fetch, where the result is intermittently 404 (on any tweet syndication url), although I'm not sure why yet. I'll keep digging, but I don't think this bug is specific to @vercel/fetch.

transitive-bullshit avatar Jun 10 '22 05:06 transitive-bullshit

The same behavior occurs using the underlying node:https module directly, so this is definitely not an issue with @vercel/fetch afaict.

The first GET is always successful, and subsequent GET requests 404. If you override the agent to disable TLS session caching, then everything works fine.

transitive-bullshit avatar Jun 10 '22 05:06 transitive-bullshit

hey @transitive-bullshit, you managed to fix the issue over here. Did you figure out if the issue is related to TLS session caching? If so, I can close this up.

sanjay-io avatar Nov 29 '22 14:11 sanjay-io

Yep; I don't think this has anything to do with @vercel/fetch.

transitive-bullshit avatar Nov 29 '22 17:11 transitive-bullshit

Thank you for the report. We are archiving this project; you can read more details here: https://github.com/vercel/fetch/issues/83

Ethan-Arrowood avatar Nov 09 '23 22:11 Ethan-Arrowood