adam
adam
CCConvex Community
Created by adam on 8/24/2024 in #support-community
Convex dashboard suggestion (DX)
It would be great to have the "Edit Document" view auto subscribe to document updates, so I don't need to re-open the edit document preview window each time I make a change.
12 replies
CCConvex Community
Created by adam on 8/21/2024 in #support-community
Convex 1.14.1 WebSocket InternalServerError
After upgrading Convex 1.13.2 => 1.14.1, I receive a "WebSocket closed with code 1011: InternalServerError" error, after initial user login. If the user is already authenticated, then I don't see this error. This error doesn't exist when using Convex 1.13.2. I'm using custom auth connected to AWS Cognito with <ConvexProviderWithAuth />. Could you please give details of the internal server error that is being raised here? I logged a support ticket on 11th Aug requesting help about this, and haven't received any helpful response.
4 replies
CCConvex Community
Created by adam on 7/17/2024 in #support-community
`completedTime` of scheduled function meta data incorrect
const response = ctx.db.system.get(jobId) The completedTime of response seems to be set incorrectly if the scheduled function calls an internal mutation. Seems to be set correctly if the scheduled function is for an internal action.
{
"_creationTime": 1721200676326.9324,
"_id": "kc29zypvpyzcjw9k06qtawm2qh6x262n",
"args": [
{
"orderId": "ks70esgps7akdvhp807zxc4hhx6x38p6"
}
],
"completedTime": 1721200676417.7048, // <= This comes before the `scheduledTime`
"name": "orders.js:_setTimedOut",
"scheduledTime": 1721200736327,
"state": {
"kind": "success"
}
}
{
"_creationTime": 1721200676326.9324,
"_id": "kc29zypvpyzcjw9k06qtawm2qh6x262n",
"args": [
{
"orderId": "ks70esgps7akdvhp807zxc4hhx6x38p6"
}
],
"completedTime": 1721200676417.7048, // <= This comes before the `scheduledTime`
"name": "orders.js:_setTimedOut",
"scheduledTime": 1721200736327,
"state": {
"kind": "success"
}
}
1 replies
CCConvex Community
Created by adam on 7/17/2024 in #support-community
Scheduled function incorrect response value (unexpected `jobId` property)
When I run const jobId = await ctx.scheduler.runAfter(...); from a mutation then jobId has the correct type of Id<'_scheduled_functions'> and correct value. However, when I run const jobId = await ctx.scheduler.runAfter(...); from an internal action, then jobId has the correct type of Id<'_scheduled_functions'> but it's value is of type { jobId: Id<'_scheduled_functions'>} (ie it has a nested jobId property). Convex v1.13.0
11 replies
CCConvex Community
Created by adam on 7/6/2024 in #support-community
Convex 1.13.0 missing optional in types
I seem to be encountering typescript errors when upgrading to convex 1.13.0. Take await ctx.db.insert('messages', message); for example. Here is the expected type that ctx.db.insert() expects for message:
// convex: 1.12.2
// convex-helpers: 0.1.43
{
id?: string | undefined,
name?: string | undefined,
parentName?: string | undefined,
postId?: string | undefined,
author: string,
body: string
}

// convex: 1.13.0
// convex-helpers: 0.1.45
{
id: string | undefined;
name: string | undefined;
parentName: string | undefined;
postId: string | undefined;
author: string;
body: string;
}
// convex: 1.12.2
// convex-helpers: 0.1.43
{
id?: string | undefined,
name?: string | undefined,
parentName?: string | undefined,
postId?: string | undefined,
author: string,
body: string
}

// convex: 1.13.0
// convex-helpers: 0.1.45
{
id: string | undefined;
name: string | undefined;
parentName: string | undefined;
postId: string | undefined;
author: string;
body: string;
}
await ctx.db.insert('messages', { author: 'Sam', body: 'test' }); is no longer valid because I need to explicitly define id, name, postId even though they can be undefined. Is there a way to restore the previous optional behaviour?
4 replies
CCConvex Community
Created by adam on 5/29/2024 in #support-community
Exception raised when creating new Convex project
Hi, I attempted to create a new Convex project using "+ Create Project" button, though an error was shown and the project didn't seem to be created. However, it does seem like the project was created in some way though, as it has contributed to my project limit of 5 projects. I have reached the project limit, with 4 projects, not 5. Could someone please have a look? Thanks!
8 replies
CCConvex Community
Created by adam on 5/15/2024 in #support-community
File based routing: How to organize files?
Hi, I'm looking for the best way to organise files within the convex directory. The single file such as messages.ts is becoming very large with many different mutations, queries, actions etc. I tried to create a ./messages/index.ts and then use export * from './create' from within the ./messages/index.ts file, though this approach doesn't work very well with the auto generated Convex functions. I worked out that I can use the _ prefix, eg ./_messages/create.ts for the folder (also works with files too), so they will be excluded from Convex function auto generation but the TS types are still created for these _* files and directories. My question is, am I on the right path with using _* prefix to exclude some files and folders from file based routing, or is there a better approach to organizing files?
5 replies
CCConvex Community
Created by adam on 5/6/2024 in #support-community
Database row version history?
It seems Convex internally keeps some version history of DB rows. Is it possible to view the previous version / snapshot of a given row, at a point in time? I would like to do a diff between versions to see what data has changed. Thanks
3 replies