Matt Luo
Matt Luo5mo ago

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?
No description
15 Replies
Matt Luo
Matt LuoOP5mo ago
(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)
RJ
RJ5mo ago
Each developer on a Convex team has their own dev deployment—could it be that his has no data in it?
Matt Luo
Matt LuoOP5mo ago
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
RJ
RJ5mo ago
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
Matt Luo
Matt LuoOP5mo ago
Ah okay, so is it possible for two developers to work on the same business data (in the Convex DB) at the same time?
RJ
RJ5mo ago
In a preview deployment, I would guess, but I'm no expert here (I'm still just a solo dev myself 🥲)
Matt Luo
Matt LuoOP5mo ago
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)
ballingt
ballingt5mo ago
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
jamwt
jamwt5mo ago
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
Matt Luo
Matt LuoOP5mo ago
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.
ampp
ampp5mo ago
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.
Matt Luo
Matt LuoOP5mo ago
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.
Michal Srb
Michal Srb5mo ago
@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.
ampp
ampp5mo ago
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.
Michal Srb
Michal Srb5mo ago
Great, that's the intended workflow!