Closed samuelstroschein closed 1 year ago
What's the stack trace of the object that has abort: true
?
@brillout
The stack trace is empty on client-side navigation WHEN a session exists that is used with getContext, see screenshot 1.
The stack trace shows fetch as an error that occurred due to sentry's fetch wrapping ... interesting. UPDATE: It is not sentry. I removed sentry and deployed -> the error persists.
On server-side rendering, the stack trace throws at fetchInterceptor
, see screenshot 2.
This got to be one of the weirdest bugs I ever encountered. Adding a console.log()
solves the bug. See https://github.com/inlang/inlang/commit/0121a2da19db8195f94f5b7815d5ca1ceca18059.
I found the root cause(s):
createResource
SolidJS's createResource
function is documented to be used as follows:
const [data, { mutate, refetch }] = createResource(fetcher);
The result of using createResource
without wrapping the fetcher
function in a wrapper like () => fetcher()
leads to arguments being passed down to the fetcher function which is somewhat hidden in the documentation.
Telefunc generates shield functions for arguments automatically. But, passing bad arguments to an API call is not a 403 (forbidden) but a 400 (bad request) status code. The 403 status code lead to an hour-long wandering path that the problem was related to auth.
After mounting the DOM, the telefunc function was executed again to check if a user is logged in. That led to the phenomenon of "the telefunc function returns the value". The telefunc function responsible for rendering the error throwed as expected.
Thanks for detailed report.
I am also getting the error of 403 when the argument is bad using react. I agree it should be 400 instead of 403, and ideally the response should say that argument is bad. I wonder if there is a proper way to see this error? because it is confusing when I received it.
Problem
A telefunc function throws a 403 error that should not be thrown. The function of question can be found here https://github.com/inlang/inlang/blob/main/source-code/website/src/services/auth/logic.telefunc.ts
To reproduce
Investigation
Additional information
telefunc-version: "^0.1.41"
Error on oauth callback
Error on SSR the site https://inlang.com/services/auth/oauth-callback
The telefunc call is aborted for unknown reasons.