Convex Community

CC

Convex Community

Join the Convex Discord! Explore Convex, the fullstack TypeScript platform for developers and startup founders.

Join

support-community

show-and-tell

general

open-source

announcements

IdTokenExpired on using convexAuthNextjsToken in production

Error: {"code":"IdTokenExpired","message":"Expired: ID token expired at 2024-08-27 01:49:03 UTC (cur

Convex Monorepo Issue (react-dom native)

when ever i install "react-native-tab-view": "^3.5.2", my native apps break. i get the same error when i install other modules too. I don't see the connection between the packages i'm installing and the error. I haven’t touched any other part of the repo yet. ...
No description

`withOptimisticUpdate` with custom (auth) mutations

I have the following custom mutation: ```ts export function useAuthMutation<Mutation extends AuthFunction<"mutation">>( name: Mutation ) {...

Showing save status with optimistic update

Suppose we store the configuration of a grid in convex, and we want to use optimistic updates to show the grid layout updating instantly when users drag stuff around. How can we easily show whether their changes have been saved or not? One way to do it is to have a flag in the query output like isServerValue which is set to true on the convex query and false in the optimistic update... Does anyone have better ideas?...

`convex-test` could not find the "_generated" directory

Just installed convex-test and wrote a very simple test at the root of my /convex folder. Running it produces an error:
Error: Could not find the "_generated" directory, make sure to run `npx convex dev` or `npx convex codegen`. If your Convex functions aren't defined in a directory called "convex" sibling to your node_modules, provide the second argument to `convexTest`
Error: Could not find the "_generated" directory, make sure to run `npx convex dev` or `npx convex codegen`. If your Convex functions aren't defined in a directory called "convex" sibling to your node_modules, provide the second argument to `convexTest`
My _generated directory is present and my convex functions are all in /convex at the root of my project. Not sure what might be the issue....
No description

Query Speed Up

please how do I optimise this query, I feel like am not doing it the right way ```ts export const list = query({ args: {}, handler: async (ctx) => {...

Deleting users with Convex Auth

What's the best practice for deleting users when using Convex Auth? There aren't any examples in the docs, and removing only the row on the users table throws an error if you try to sign up with the same email. `` Error: [CONVEX A(auth:signIn)] [Request ID: af708226cadf810c] Server Error Uncaught Error: Uncaught Error: Could not update user document with ID k174brjwcmhn3gsa85rymdcr4n6zw26q, either the user has been deleted but their account has not, or the profile data doesn't match the users` table schema: Update on nonexistent document ID k174brjwcmhn3gsa85rymdcr4n6zw26q...

Guarantees for the timing of scheduled functions

Hey folks, I've got a question regarding the timing of scheduled functions (not cron jobs). While the docs describe guarantees regarding how often they are retried I haven't seen details about guarantees on the timing. I was curious if there are guarantees that the functions will be invoked on time (or at least with minimal delay) unlike with some other services where I've experienced up to minutes of delays.

Redirecting unauthenticated users? Convex Auth + TanStack Router

Hi! Hopefully this is an easy one, but I'm new to both Convex, TanStack, and this is my first time ever setting up authentication! So trying to follow best pratices and reading but getting a little lost. I have a /settings route and I want to redirect unauthenticated users away to /signin. I found the docs in TanStack Router for how to set up a redirect on beforeLoad but I don't know how to check for isAuthenticated() using Convex Auth. Help? https://tanstack.com/router/latest/docs/framework/react/guide/authenticated-routes#redirecting...

How to define a type that is the return type of a Convex query

Suppose I want to declare a type at the top of a file like so: ```ts type FirestoreCollectionResult = { db: Firestore; cFirestoreConfig: any;...

Convex Auth - User maintenance

Does Convex Auth currently have the ability to perform User maintenance tasks (mutations) from an admin dashboard:- 1. Create user - ability to create a user without a password, Clerk does a good job of this in that you can create the user using Email and when the user logs on without a password (because they don't have one), they receive a magic link. The user will continue to log in this way until they create a password through their 'Manage account' functionality. 2. Update user - ability to change email or any of their profile (user) details....

Uptime monitoring

Any best practices or documentation for uptime monitoring with convex? I'd like to use for example betterstack to be able to ping my custom domain and notify me of any issues, but I cant find any documentation or examples on how it can be done, especially for the web socket endpoint. I'd prefer a standard /healthz endpoint to ping that returns 200 then it is alive and well

joinplayroom

I have to use joinplayroom and convex. The reason for each function call is 60 fps is expensive. Are you planning such functions of rooms as before without a database to make it cheaper?

Convex Auth on React Native (expo)

I'm trying to connect my convex backend to a react native app made with expo. This backend is already used by my ReactJS app which is external to this expo project. I simply want the two projects to share the same database. The problem I'm having is with the OAuth connection to Google. My current configuration of Convex *(env variables) * is designed to work with the web version. I can't find a solution allowing me to connect Google OAuth with Convex Auth without getting these errors: ...

How to easily update a single nested field?

Why does the dynamic of updating a top level field not apply to nested fields? For instance, why can't I do: ```ts await ctx.db.patch(doc._id, {...

withOptimistic in fetchMutation

Is there a way to use withOptimistic in fetchMutation? I tried to usereact useOptimistic hooks with preloadQuery but
Preload<typeof api.dbquery>
Preload<typeof api.dbquery>
somehow _id and _createdTime is required in new obj....

schema validation conflicts too verbose

see screen recording for an example. Would be great if we could see a clearer diff on the conflicting fields vs a full print of the document and schema for a table (which can get very lengthy as you can see)

Convex Auth 'Invalid verifier' on safari

On safari, I am getting 'Invalid verifier' when trying to login using github or google. The authAccounts and users are being created. I have no problem with Chrome, it works as expected. See screen shots, 1st is safari and 2nd is chrome....
No description