Do geographically distant developers experience different errors?
I'm working with a new colleague who is running our Convex app on his local machine in India.
He is experiencing errors that I cannot reproduce from the US East Coast. Screenshot attached of a "Server Error Uncaught Error: Query returned no documents". I have never seen such an error.
If he runs
npm run dev
for a Next.js app, and npx convex dev
, all on his laptop, does his running of the app somehow cause a different order of operations?15 Replies
(By the way, in the scenario for this error message, it is expected that the end user, which is a brand new user, to not have any directMessageChannels)
Each developer on a Convex team has their own dev deployment—could it be that his has no data in it?
his new local project seems to overwrite the Convex URL in the env.local. Like my project says brazen-orca but his says cherry-bulldog
Yeah, that's intended. I'm not sure if it's possible to share a dev deployment, but I would guess not. An easy fix for now might be to just take a snapshot of your dev deployment and have him import that into his
Ah okay, so is it possible for two developers to work on the same business data (in the Convex DB) at the same time?
In a preview deployment, I would guess, but I'm no expert here (I'm still just a solo dev myself 🥲)
Ah okay. I suppose I have to duplicate some work for each developer. Like, I now need to make two Clerk webhooks (to call two different Convex site URLs)
You can do this with a dev deployment too, it's just a bit worrying because you'll be clobbering each other's code deploys
ie there's not way to have different sets/versions of Convex functions working with the same DB at thsi time
the usual model is each dev has their own deployment; if folks want similar seed data to iterate on, they can use an internal function to populate it, or a convex import
sharing dev deployments is pretty tricky yeah, b/c you'll race each other to push up conflicting code changes
okay, thanks. The multiple-developer experience is clearer to me now.
To recap this post
1) I did fix this issue. It is actually a misleading error messaging from Convex Ents. I think what that error message is really saying is that there is missing referential integrity from the users table.
2) The reason why there was nothing in the user table was because the webhook from Clerk was not making calls to the new Convex site (that my colleague owns).
3) A discovery I made while adding multiple endpoints to the same Clerk webhook is that the Clerk webhook sends to both Convex dev sites. As far as I can tell, there is not a way to make a webhook only call one endpoint (depending on which Convex site initiated the process). This may very well be a Clerk-specific limitation, but I imagine other Convex customers will run into this issue.
If I really want Clerk webhook calls to only go to the particular Convex site that instantiated the workflow, I suppose I could create a Clerk app per Convex site.
So we have our own clerk and convex projects but share team access. Then for pair programming i have access to everything i need with vscode live share and can see everything else. If you have two distinct environments running on the same project that's just unworkable. Our nightmare has been with live share and consistent issues with typescript/eslint and prettier. Its not as fast as local, i need to figure out how to fix that. It just acts like i don't exist unless im in the same file.
I'm assuming you are talking about this: https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare
Yeah, I think the only way to make sure that not every dev has Clerk prod access is to make a Clerk app per Convex project
Live Share - Visual Studio Marketplace
Extension for Visual Studio Code - Real-time collaborative development from the comfort of your favorite tools.
@ampp is your dataset so large / complicated that you can't each have your own dev environment? Or is it about an evolving schema that's hard to keep in sync? All feedback appreciate, we certainly don't intend the live-sharing like this to be required.
We do each have our own environment working but we were often sharing one for pair programming, we just haven't been doing it as much because of the problems with typescript/eslint not sending updates and the formatter issues. Some of it probably has to be that WSL is in the mix. When i had tried using the same convex project for both environments it was the constant schema changes that would cause the friction. It seems like it would work if i could live sync the two convex folders. But we are happy with the each dev has their own setup way.
Great, that's the intended workflow!