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

Client doesn't surface auth errors #5

Open
mtarnawski opened this issue Dec 5, 2024 · 3 comments
Open

Client doesn't surface auth errors #5

mtarnawski opened this issue Dec 5, 2024 · 3 comments

Comments

@mtarnawski
Copy link

Hi Convex team!
I've encoutered a strange error:

convex client is freezing on query when the .set_auth() is used prior to the query.

Version of Convex Python client: 0.6.0

Reproduced on two independent machines.

import convex
client = convex.ConvexClient("https://colorful-scorpion-774.convex.cloud")
client.set_auth("<JWT_TOKEN_FROM_WORKOS_LOGIN flow>")
org = client.query("organizations:getByWID", {"workos_id":"org_01JDZBZEDH7MYNG9CBSR"})
print(org)

//the above query is public and returns proper result if the set_auth was not invoked, and hangs indefinitely if it was invoked.

$python3 --version
Python 3.13.0

I'd be grateful for confirmation if the bug can be reproduced (and fixed).

@thomasballinger
Copy link
Collaborator

Is this JWT known to work with Convex, e.g. from the JavaScript client? That code would be

const c = await import("https://esm.sh/[email protected]/browser");
const client = new c.ConvexClient("https://colorful-scorpion-774.convex.cloud");
client.setAuth(() => "<JWT_TOKEN_FROM_WORKOS_LOGIN flow>")
const result = await client.query("organizations:getByWID", {"workos_id":"org_01JDZBZEDH7MYNG9CBSR"});
console.log(result);

If this also doesn't work then the issue with the Python client is that this should fail more loudly. If it does work then we know it's a Python client issue.

It'd be even easier to debug this if we had a debugging JWT we could use, is there one you have from a test application that would be ok to expose? Or could you send me the one that's failing privately, either through the Discord server or email to [email protected]?

@thomasballinger thomasballinger changed the title Client hangs indefinitely on query if Client doesn't surface auth errors Dec 5, 2024
@thomasballinger
Copy link
Collaborator

Several things to fix:

  • an expired token doesn't surface a good error
  • a token that doesn't match the provider doesn't surface a good bug

@dbudgenh
Copy link

Any progress on this?

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

No branches or pull requests

3 participants