Heath
Heath
CCConvex Community
Created by Actualize on 10/8/2024 in #support-community
Convex + Nextjs using preloadQuery inside layout.tsx
I assume it helps with first page load speed due to the page content being fully cacheable by cdn / edge
7 replies
CCConvex Community
Created by shea on 9/1/2024 in #support-community
IdTokenExpired on using convexAuthNextjsToken in production
I see this too in our project
95 replies
CCConvex Community
Created by kebinnnnn on 9/17/2024 in #support-community
Auth is working in development but getting an error after deploying on Vercel
Did you run the initialization command? You can run the initialization with --prod to configure it for prod: https://labs.convex.dev/auth/production
6 replies
CCConvex Community
Created by Slade_Wilson118 on 9/14/2024 in #support-community
building app for web and mobile
There was an announcement recently about something relevant to what you’re trying to do. Maybe this helps, https://docs.convex.dev/production/multiple-repos
6 replies
CCConvex Community
Created by Bogdan on 9/12/2023 in #support-community
Handle client disconnecting?
@sujayakar thank you very much for such a comprehensive response. We are prototyping right now on some greenfield work, so a lot of this discussion is premature, but nonetheless I am comparing some things as we go to our larger main product and it's valuable to have data points like the ones you've shared.
55 replies
CCConvex Community
Created by Bogdan on 9/12/2023 in #support-community
Handle client disconnecting?
Doing beforeunload but I dabbled with both unload and pagehide today and it didn’t help (but may be worth a revisit now that my implementation stabilized)
55 replies
CCConvex Community
Created by Bogdan on 9/12/2023 in #support-community
Handle client disconnecting?
ok makes sense. tbh I don't know that it's "regularly" since it's much more common for people to just close tab or reload page. I think I will need to do a careful comparison of worse clients though, particularly Safari and mobile.
55 replies
CCConvex Community
Created by Bogdan on 9/12/2023 in #support-community
Handle client disconnecting?
yes, exactly.
55 replies
CCConvex Community
Created by Bogdan on 9/12/2023 in #support-community
Handle client disconnecting?
I wouldn't be surprised if Pubnub is using all these things at once
55 replies
CCConvex Community
Created by Bogdan on 9/12/2023 in #support-community
Handle client disconnecting?
I implemented a Beacon (w/ beforeunload) today + timeout, and was just comparing the effectiveness to our main product which is using Pubnub, and came across some edge conditions that didn't work with the beacon. The main one I noticed was w/ Firefox where if I do a page transition (for instance typing a new URL into the URL bar) it won't fire the beacon
55 replies
CCConvex Community
Created by Bogdan on 9/12/2023 in #support-community
Handle client disconnecting?
Hey @jamwt, really appreciate the response!
55 replies
CCConvex Community
Created by Heath on 9/12/2024 in #support-community
Setting auth from within an HTTP action
er, yes, mutation!
14 replies
CCConvex Community
Created by Heath on 9/12/2024 in #support-community
Setting auth from within an HTTP action
I do feel that this functionality is useful beyond my beacon, for instance if an http action wants to authorize a user using some external source and then impersonate them for a runMigration() runMutation() or runQuery(). It feels tedious and messy to build a parallel set of internal methods
14 replies
CCConvex Community
Created by Heath on 9/12/2024 in #support-community
Setting auth from within an HTTP action
BTW I did try overwriting request.headers.Authorization, hoping it would influence the auth used for runMigration runMutation, but it did not.
14 replies
CCConvex Community
Created by Heath on 9/12/2024 in #support-community
Setting auth from within an HTTP action
Sounds like what you want is something like auth.extractIdentity(jwt) and then we could pass the JWT in as an argument.
Yes, that would be great. Or one of these options would be even better, 1. something like ctx.auth.setIdentityFromJwt(jwt) which would then allow me to set the identity for the current request from a source other than the http header. 2. Additional arguments on runMigration runMutation that allows me to somehow influence the token used to run the migration mutation.
14 replies
CCConvex Community
Created by Heath on 9/12/2024 in #support-community
Setting auth from within an HTTP action
btw I found this method http.runRequest(), but I cannot find any use of it or sample code, but the documented description sounds potentially relevant, allowing me to just loop a request back into the router. Do you have any details on this?
Given a JSON string representation of a Request object, return a Response by routing the request and running the appropriate endpoint or returning a 404 Response.
14 replies
CCConvex Community
Created by Heath on 9/12/2024 in #support-community
Setting auth from within an HTTP action
As a hack, I guess you could have one HTTP action for sendBeacon, which contains the JWT as an argument, and then in that action just do a fetch to another one of your HTTP actions, but this time setting the Authorization header?
@sshader haha yeah 😄 I actually did this already, I just didn't want to reveal I had a solution because it feels like such a hack
14 replies
CCConvex Community
Created by Heath on 9/12/2024 in #support-community
Setting auth from within an HTTP action
hm, yes - but I know that Convex is handling all this stuff already, and was hoping for some method that would allow me to avoid reimplementing that kind of logic in my codebase.
14 replies
CCConvex Community
Created by Heath on 9/12/2024 in #support-community
Setting auth from within an HTTP action
I could pass the JWT to the mutation, but how can I validate the JWT in the mutation? I also could pass userId to an internal mutation, but I need to first validate the JWT to know the authoritative userId
14 replies
CCConvex Community
Created by Bogdan on 9/12/2023 in #support-community
Handle client disconnecting?
@ian It would be valuable to have access to client connection/disconnection events on the server. This would allow us to build presence functionality that is matching how some more specialized vendors handle presence. For example here's how Pubnub describes how their websocket is used to track leave events:
Generate Leave on TCP FIN or RST This option will detect the connection termination of a network layer and report it as a PubNub leave event. A leave event instead of a timeout event will be generated when a browser tab is closed or an application is force quitted.
Without that I believe we are left depending on unload events (can be unreliable) or a heartbeat timeout (fine as a failover but not for snappy presence). Let me know though if there's something I'm missing. @LeoCaprilin I saw you are using sendBeacon, but which event are you using to fire the beacon?
55 replies