nb
nb
CCConvex Community
Created by nb on 1/19/2024 in #support-community
Hand-rolled python client getting blocked from connecting?
Oh awesome! Let me give this a shot at some point when I have a second... it might not be for a week or two.
15 replies
CCConvex Community
Created by nb on 1/19/2024 in #support-community
Hand-rolled python client getting blocked from connecting?
Just to close the loop on this for anyone else following along, turns out there is a nice error message that started showing up once I turned on my websocket message logging. Will definitely make sure to check that next time. In the meantime, everything is fixed. Thanks again @ballingt!
sending {'type': 'Mutation', 'mutationId': 1, 'udfPath': 'tick.js', 'args': [{'sha': 'dev', 'release_ts': None}]}
sending {'type': 'ModifyQuerySet', 'baseVersion': 0, 'newVersion': 1, 'modifications': [{'type': 'Add', 'queryId': 1, 'udfPath': 'newRunAvailable.js:default', 'args': [{}]}]}
got message:
{"type":"FatalError","error":"Received Invalid JSON on websocket: missing field requestId"}
sending {'type': 'Mutation', 'mutationId': 1, 'udfPath': 'tick.js', 'args': [{'sha': 'dev', 'release_ts': None}]}
sending {'type': 'ModifyQuerySet', 'baseVersion': 0, 'newVersion': 1, 'modifications': [{'type': 'Add', 'queryId': 1, 'udfPath': 'newRunAvailable.js:default', 'args': [{}]}]}
got message:
{"type":"FatalError","error":"Received Invalid JSON on websocket: missing field requestId"}
15 replies
CCConvex Community
Created by nb on 1/19/2024 in #support-community
Hand-rolled python client getting blocked from connecting?
Great to hear RE: official python client, I just have a small personal app that I'd like to use in the meantime so may end up spending a bit of time on this, but will stop if it's taking too long, and obviously I will be the first to implement the official python library when it supports realtime 🙂
15 replies
CCConvex Community
Created by nb on 1/19/2024 in #support-community
Hand-rolled python client getting blocked from connecting?
Oh ok cool, I'll debug more on my end to figure out what's going on then. The behavior seemed like something was blocking me, but if that's not the case, I'll just spend a bit of time figuring out how the behavior changed and fix on my end.
15 replies
CCConvex Community
Created by nb on 7/29/2023 in #general
Co locating queries in client side code
Yup, makes sense!
11 replies
CCConvex Community
Created by nb on 7/29/2023 in #general
Co locating queries in client side code
Ah yeah I think I'm using vite w react, but honestly I'm a bit rusty on all the different frameworks/bundlers right now. Back in the day everyone used webpack as a bundler, but maybe nowadays there are a bunch to support. If there was support on one blessed stack, would probably move my project to it.
11 replies
CCConvex Community
Created by nb on 7/29/2023 in #general
Co locating queries in client side code
Yeah totally -- it'd be tricky to get completely right. With an intermediate representation of queries (like GraphQL), there's no real magic happening, but I imagine it's hard to do w JS functions cleanly for all the reasons the talk describes. (And I definitely don't have the answer myself!) Definitely not a blocker, just figured I'd throw it out there as a thought I had since I was noticing the 1:1 query function to react component pattern in my own code.
11 replies
CCConvex Community
Created by Dan Mercer on 1/3/2023 in #general
Auth0 token expired
Oh you know, this is probably because auth0-react 2.0.0 just came out last month. That at least explains the redirect_uri thing, not sure if it explains the token expiration. https://github.com/auth0/auth0-react/blob/master/MIGRATION_GUIDE.md
42 replies
CCConvex Community
Created by Dan Mercer on 1/3/2023 in #general
Auth0 token expired
Yeah, that's right. The comment I linked to above by the Auth0 employee seems to think expired ID tokens are totally fine and it's ok to trust local cache. I wonder if local cache for Auth0 has some sort of a different expiration for session lifetime stored, and just relies on that for when to refetch the token.
42 replies
CCConvex Community
Created by Dan Mercer on 1/3/2023 in #general
Auth0 token expired
RE: that line, I think Auth0 returns a cached and expired id token there.
42 replies
CCConvex Community
Created by Dan Mercer on 1/3/2023 in #general
Auth0 token expired
Ah OK, there might be something weird with my setup. I'm using @auth0/auth0-react @ 2.0.0 and had to change ConvexProviderWithAuth0 to pass redirect_uri like this: { domain, clientId: authInfo.applicationID, authorizationParams: { redirect_uri: typeof window === "undefined" ? void 0 : window.location.origin, }, cacheLocation: "localstorage" }, instead of at the top level of the dictionary to get auth/redirect to work. That might be a sign that something's wrong with how I set up my repo / I'm using an old version / etc. Let me look into this and follow up.
42 replies
CCConvex Community
Created by Dan Mercer on 1/3/2023 in #general
Auth0 token expired
0.9.0
42 replies
CCConvex Community
Created by Dan Mercer on 1/3/2023 in #general
Auth0 token expired
I'm getting something similar. When I inspect the ID token returned by react Auth0 in jwt.io, I see that it's expired, even though isAuthenticated() returns true. My theory (this is my first time using Auth0!) is that this is normal: https://community.auth0.com/t/id-token-expiration-check/76453/3, but the convex server for some reason demands a non-expired token. Changing the call to getAccessTokenSilently() in ConvexProviderUsingAuth0 to add cacheMode: 'off' forces Auth0 to get a new token each time. It seems these default to 36000 seconds or 10 hours, so this only appears 10 hours after authenticating. This seems like a maybe a bug with Convex? I think these tokens are supposed to be used once at login to verify the user is who they are, and then that session is supposed to persist on the client/server without requiring revalidation of the token. There might be a different Auth0 API needed for server side checks?
42 replies