ian
ian
CCConvex Community
Created by cake on 5/13/2025 in #support-community
Workflow for migrations?
I hear you, I’m still thinking about the right way to balance that. I suspect you’ll appreciate the “pretends” validators. Also remember you can just turn off schema validation for a while and turn it back on later. You’ll still get types. I wrote a Stack post on moving fast - search for “yolo”
15 replies
CCConvex Community
Created by cake on 5/13/2025 in #support-community
Workflow for migrations?
As for how to manage old migrations, I recommend commenting out the old migration and also pasting in the old schema, so you have a running log without checking git history, and you can patch in old things to migrate multiple previous steps if necessary. But the whole "migrate up" workflow is admittedly annoying right now - you can't have a dev deployment jump multiple schema phases easily. I've thought about whether scripts make sense here. but often folks go with a "seed" script and just blow away their dev data liberally
15 replies
CCConvex Community
Created by cake on 5/13/2025 in #support-community
Workflow for migrations?
If you only want to handle the types of the final result (and accept that sometimes they'll be wrong at runtime), you can use this helper: https://github.com/get-convex/convex-helpers/blob/main/packages/convex-helpers/validators.ts#L295-L334 which allows you to pretend the type is required.
15 replies
CCConvex Community
Created by cake on 5/13/2025 in #support-community
Workflow for migrations?
Ultimately the challenge is that when you want to change your schema, your data won't all magically change instantly. So you have to decide whether you want to handle the intermediate state where your app is "broken" . Other platforms do this synchronously with a deploy - essentially failing requests during the deploy & migration. I've worked at multiple companies where this pattern led to hour+ outages when a migration failed midway continually timing out, preventing rolling back or fixing forward until manual DB surgery was performed. I'll admit this was with millions of users, not something most apps run into.
15 replies
CCConvex Community
Created by cake on 5/13/2025 in #support-community
Workflow for migrations?
15 replies
CCConvex Community
Created by uzamaki21 on 5/4/2025 in #support-community
is there a filter in convex dashboard like contains ?
When I've wanted this, I've written a custom query in the dashboard UI - you can fetch from the table and do a .includes in typescript
4 replies
CCConvex Community
Created by David Alonso on 5/7/2025 in #support-community
`zdoc` zod validator (similar to `zid("tableName")`)
Open to contributions too
5 replies
CCConvex Community
Created by David Alonso on 5/7/2025 in #support-community
`zdoc` zod validator (similar to `zid("tableName")`)
There is withSystemFields("users", { foo: z.string() }) which adds the system fields, if that helps?
5 replies
CCConvex Community
Created by loliklr:) on 5/5/2025 in #support-community
Allowing user to update value streamed from LLM
yeah exposing a method to update/delete a message by ID seems reasonable (assuming the message ID is exposed)
4 replies
CCConvex Community
Created by igor9silva on 5/5/2025 in #support-community
VAT/tax ID on invoice
Without Convex collecting & remitting VAT things, would it be much benefit? So it'd require those billing capabilities before it's useful? What country are you in?
5 replies
CCConvex Community
Created by panzacoder on 5/5/2025 in #support-community
Nested convex folders & Type inference
That's not expected. My suspicion is that there's some issue with circular types or something where the TypeScript server is giving up. Are you by chance putting the schema in one of these files that also exports a function? The query/mutation/action functions depend on schema.ts, which depends on the files it needs to import from. I find having a "pure" file (doesn't import anything with imports from _generated) like assistants/tables.ts that things import from. To debug, I would consider: - Make a simple project with this hierarchy with very basic functions to ensure it works in the "simple" case. Maybe it's something to do with your project's tsconfig, or your imports. - Look at how the types are defined in _generated/auth.d.ts and re-create that only importing files in the sub-folder to inspect what the types look like. - Gradually delete functions to see if that resolves it. Note: when you're adding/removing files, you need to make sure npx convex dev is running so the codegen files stay up to date Once you have something that is working, you can bisect to find what about your project is breaking it. With a minimal reproduction of the issue, I'd love to know what other users / Convex can do to fix this if they run into it
2 replies
CCConvex Community
Created by Ale4224 on 5/1/2025 in #support-community
@convex-dev/agent MessageDoc resolves to any
It should be fixed in the latest version. let me know if not
3 replies
CCConvex Community
Created by Ale4224 on 5/1/2025 in #support-community
@convex-dev/agent MessageDoc resolves to any
That’s very curious, maybe it is something about the tsconfig/ how I am bundling it.
3 replies
CCConvex Community
Created by Starlord on 5/1/2025 in #general
Database Triggers
Triggers does some locking to prevent this. If you can get a minimal repro, that'd be awesome
62 replies
CCConvex Community
Created by Starlord on 5/1/2025 in #general
Database Triggers
Are they happening in parallel promises? If so, they might be racing
62 replies
CCConvex Community
Created by nibab on 4/30/2025 in #support-community
runAfter(0, ... timing
Ah yeah, calling things directly is way more efficient than doing ctx.run* when it can be avoided - the latter starts a new isolate container. Retries wouldn't surface like that in the dashboard, so I'm guessing that somehow you're calling the mutation three times in the same POST request, or one is calling the next.
12 replies
CCConvex Community
Created by nibab on 4/30/2025 in #support-community
runAfter(0, ... timing
Have you considered doing a Promise.all on reading / updating the elements btw? I'm surprised that you'd see 10s iterating 250 things, but maybe there's a mix of expensive operations happening under the hood? Or are you using Components like aggregate?
12 replies
CCConvex Community
Created by nibab on 4/30/2025 in #support-community
runAfter(0, ... timing
Not sure if this is what you're seeing, but everything scheduled in a mutation will not be started until after the mutation commits. So if each mutation schedules the next one, they'll run serially.
12 replies
CCConvex Community
Created by orykevin on 4/22/2025 in #support-community
Agent Component to generateObject
Would you mind confirming if it works for you in the alpha version without providing that field? I think it makes sense to not require it for the default object case
8 replies