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

self-hosted

announcements

Best Practices for Ensuring Data Consistency and Availability

Hi team, I'm building a financial app on Convex where users track spend and borrow, similar to a ledger. Given the critical nature of financial records, I want to make sure that even if the database goes down right after a transaction, no data would be lost. I have backups enabled, but since they only run once per day, I'm concerned about data between backups. Are there recommended patterns for writing critical transactions to guarantee durability immediately after a mutation succeeds? Or is there a way to get stronger durability guarantees (e.g., multi-region replication, etc.)?...

is convex down?

Can't reach server or dashboard. using cloud setup

Architecture help for search page

Hello, I would like some help w/ designing a search page that has two components: a search bar and a search results lists. I have already the docs for searching and paginations on Next.js's website. However my SearchBar component uses some useQuery hooks which causes issues w/ fetching the user. For instance, instead my SearchBar, I have 3 buttons, one of which, gets the user folders and lets the user add the search query a folder. However whenever this query is run, the user is returned null....

How do i fix: error while evaluating your schema?

I keep getting this error when running convex dev. Hit an error while evaluating your schema: Uncaught Error: Environment variables unsupported when evaluating schema...

Any working solution/examples of using TanstackStart + Convex Auth

Good day everyone I have spent the past month rebuilding a tutorial project from @CodeWithAntonio which was his JIRA clone. I Ported it to TanstackStart, Convex and Clerk from appwrite+ Next.js. I finally deployed on Netlify and i am getting some "clerk_handshake" issues that gimme a redirected too many times error whenever i try to open the site....

How to properly mock Convex internal actions in tests

I'm trying to write tests for a function that uses AWS KMS decryption (fetchSomething). This function relies on internal.kms.decrypt action. I've tried several approaches but all attempts resulted in type errors or failed decryption. What's the correct way to mock an internal action in Convex tests?...

AuthenticationFailed: Invalid Convex deploy key

I'm trying to deploy a new project to Vercel, but just can't seem to get past this "Invalid Convex deploy key" error. I've triple checked that my NEXT_PUBLIC_CONVEX_URL and CONVEX_DEPLOY_KEY are correct. I even had them print them in the build log and they are correct. My deploy key says "Never used" I was able to deploy locally with CONVEX_DEPLOY_KEY=your-key npx convex codegen What am I missing?...

"Upgrading" Anonymous accounts to "real" accounts with email

Out of the gate when you log in to my react native application, I give you an anonymous account. My goal is to push the user into signing up and at that point we "upgrade" the account from an anon to a "proper" account. I know that this will require some custom account linking outlined briefly here: https://labs.convex.dev/auth/advanced#account-linking But from where I'm sitting I'm trying to nail down the best pattern that makes it such that the user does not lose any data. The goal being give them access to the app with as little barrier as possible and make them want to sign up. The thing that is a sticking point is right now I'm using Resend OTP codes, and I don't see a clean way to just give the built in Resend/Email functionality an existing userID, and the built in flow generates a new UserID when the flow begins. Is there a way to better call these internal things or should I just kinda... re-implement the OTP functionality? Will I have to do the same with the OAuth providers when I get to that? (Was planning on adding them in addition to OTP when the app is closer to production) Is there an example somewhere of this upgrade path? I'll happily share anything I have so far....

Convex cron jobs do not show logs for some run instances

Was wondering why on the convex dashboard under schedules / crons / [specific cron] , I can see a list of runs, but only see the logs for some of them. It's the same function, why would it log or not log out something sometimes?

`useQuery` returning type `never`

I have a monorepo with PNPM workspaces and TS project references and in one package @ns/convex I have all the Convex code and in another @nx/nextjs-app I develop my Next.js client. Everything works well, except that TypeScript infers useQuery's return type to never. ```ts // in packages/convex/src/chat.ts export const getMessages = query({...

Type instantiation is excessively deep and possibly infinite.

const current = new Date(now - i * dayInMs); current.setUTCHours(0, 0, 0, 0); const dayStart = current.getTime(); const dayEnd = dayStart + dayInMs;...

Connection issue

Hey guys I seem to have a connection issue on my home internet connecting to convex. When I run a npx convex network-test I get this respoonse: ✔ Deployment URL: https://dusty-salmon-415.convex.cloud ✔ OK: DNS lookup => 52.54.48.130:ipv4 (38.54ms) ✖ FAIL: TCP connect (AggregateError) ...

Deployed an App built w/ Chef: How do I end it?

I've already deleted the project I was working on and I do not see any open projects or servers in my dashboard. However, the weblink still works and shows a portion of the created app that was built. How do I completely end that deployment or even access that same deploy link to possibly use again? Is that link directly tied to my account and always will display whatever I deploy? Thank you for any help or advice!

ESLint Errors in Vite Template

Does anyone else get this type of eslint issue when using the default Vite template? `` Parsing error: ESLint was configured to run on <tsconfigRootDir>/convex/backfill.ts using parserOptions.project`: - <tsconfigRootDir>/tsconfig.node.json...

Quick Reset for Dev DB

Is there a quick reset for dev data? Or is it better to just do a local dev when needing to do that. Essentially I am making changes fast, creating a function create initial set of data and would like to just reset it sometimes easily....

Aggregating by userId and creationTime

Hi im using the Aggregate Convex component. I'm having trouble trying to figure out how I might implement these functions. Right now I believe they are aggregating all tasks. I was wondering how i could further filter to specific userIds? ```ts import { TableAggregate } from "@convex-dev/aggregate";...

Normilization Best Practices

Does anyone have a guide to best practices for normilization of the tables in Convex, maybe assumptions you would do in RDMS/SQL but wouldn't do in Convex.

Multiple Clerk Apps with 1 Convex

Is it possible to use 1 Convex DB with multiple Clerk applications? My use case is this: - Backend Clerk App - This is used by our customers to maintain their data - Customer's Portals - This is used for their customers to submit data. ...
Next