Convex Community

CC

Convex Community

Join the Convex Discord! Explore Convex, the open-source reactive database for app developers.

Join

support-community

show-and-tell

general

self-hosted

announcements

How scalable is convex realy?

So im loving Convex so far. Its realy sweet. Im almost sold. But the biggest question of all: How scalable is it ? e.g. facebook has 383 million facebook users ... searchich a table of 383 user entries must be horrible in terms of performance, so they probably partition their user table and do all other kinds of optimization. With convex on the other hand, who will do that optimization ? Is the backend so genius to just do it all by itself? Are we as developers in charge of making such big tables work (if so how)? Or is the convex team manually optimizing projects as soon as they hit a certain size and generate good revenue for the company? ...

[Convex-Swift] No way to detect silent disconnections / connection state #5

Hi team 👋 I’m running Convex in production with the Swift SDK, and I’m hitting a recurring problem: * The app will sometimes silently drop the Convex connection (likely the WebSocket getting wedged or a transport error)....

Server-side query subscription (WebSocket)

Are there any limitations to using https://docs.convex.dev/api/classes/browser.ConvexClient in the cloud? I use puppeteer (controlling a remote browser engine), does it pull enough "browser stuff" for https://docs.convex.dev/api/modules/browser to work?

Is a convex function code visible in the webclient ?

Hi there, I just wanted to make sure I understand this right .... If I create a function in convex. It will get uploaded to the convex server and then all the code will life there. So a malicious user, looking at the webclient javascript only sees useMutation(api.myfunction) but can NOT see the actual code of the function, or even modify it ? 🙃...

Excessive Deep Type Instantiation (TS2589)

Hey all, first of all - big fan of Convex, I'm about 10 days into learning it and it's been great most of the time. I've researched this quite a bit, and unfortunately, haven't found a magic bullet to fix this issue. It appears to be quite a common issue for a lot of people and I understand why. But are there any best practices or or additional Cursor rules that would prevent this from happening? I spent hours solving this in some files but not others and any minor change blows it up again. I haven't had my "AHA" moment yet where this truly starts making sense....

sharp in a bun monorepo

I'm trying to use sharp for image processing and I see it in some examples so I assume it's possible to use in a node action, but whenever I try to bundle it using the --os and --arch params for linux arm64, my convex functions fail to deploy. I've updated my convex.json to mark 'sharp' as external. My situation is a bit complicated because of using bun and using a monorepo (so everything is in a node_modules at the root). Anyone have any experience with bun/sharp/convex ?...

convex auth, how to seed users in preview deployment?

im setting up preview deployment, is there a way to seed users so i dont have to manually create users just to see the changes?

Convex + WorkOS + Sveltekit docs

Has anyone come across good docs to integrate workos and convex using sveltekit? Or am I better off using Clerk?

What is the best way to register the amount of functions beeing called per user?

First I thought I made an extra column in the user table and incremented a counter there, but in a query i cant access the ctx.patch function. Then I thought about using actions, but then I wouldnt have the realtime update of a query and in the docs it says, I shouldnt call too many actions, because they slow down the server. Soooo what could I do ? 😇...

Help: Large CSV Export Hitting Memory Limits

Goal: Enable app user to export 25,000+ records to CSV for download Constraints: - Convex action memory limit: 64 MB - Convex query read limit: 16 MB...

Error handling with Convex Auth

Okay I don't know if this is something that's very obvious and I am missing it or something that's a limitation but I am implementing Convex Auth with Password provider. But the error handling seems not very elegant. For instance, I wanna catch incorrect password and not found email. It seems to me like I am supposed to just catch instances of "InvalidSecret" and "InvalidAccountId" but this seems not very clean. Or if my implementation is wrong I would love some advice (granted this is some AI slop code but still): ``` const handleSubmit = async (e: React.FormEvent) => {...

Why is convex slower than supabase in my tests?

Hi there , Im trying different new db services to find the right one for me. I thought convex was build onto postgress and planetside, so it should be very fast. Yet when I try it compared to supabase , supabase loads todos from todos.select(*) twice as fast. Is that maybe because in supabase I could select my location (germany) and the server is closer. And convex free tier is in the US ? If so ...... How does it work with convex, if I want so serve customers in the US and EU on the pro tier, a...

Presence meta

can i send meta data with presence component like mouse location and like what object mouse drags and stuff like that ?

Best way to sync env vars across all deployments

Hey all - my team is new to convex but we've all be really enjoying working with it so far. The only big piece of friction we've been having is managing our env variables - I noticed that there isn't a centralized way to manage env vars for the entire project, it's all per deployment. I know there is project defaults, but that doesn't apply to existing deployments. The way we're working with convex internally is that everyone has their own deployment. You can imagine this starts to become troublesome after a certain point, everyone someone adds an external service we all need to go in and add env vars manually. What's the best practice for this?...

Inline queries from actions

I would like to call some very simple queries and mutations (that do nothing except a single db.get() and db.insert() call, respectively) from an action. These specific query and mutation are not going to be used anywhere except this action. Creating a separate internalQuery() and internalMutation() for each with full signature specification feels like too much ceremony and hair splitting. Is there a way to do db.get() and db.insert() directly from an action, or another way of defining "inline query and mutation" right within the action block without much boilerplate? There is an old thread: https://discord.com/channels/1019350475847499849/1019350478817079338/1213551918052544593 but I’m not sure it is still relevant....

Cannot find module 'convex/_generated/api'

Out of nowhere I started getting this type check error when running npx convex dev. The only file reporting this supposed error is a custom hook, and the import line looks like this: import { api } from "convex/_generated/api"; This same import syntax is used in a couple dozen other files with no problem: custom hooks, components, etc. The actual behavior of the custom hook is fine. No problems using the queries it contains....

Building Discord bot interactions as Convex http actions

I'm building a set of Discord interactions as http actions. I'm using Discord.js because it includes a bunch of very useful typescript types for determining the structure of the data that Discord sends your webhook and what it expects back. The problem is that DiscordJS also imports a whole bunch of node stuff, which I don't care about. Sadly, I can't just do
import type {Foo, Bar} from "discord.js"
import type {Foo, Bar} from "discord.js"
...

Websocket status

My react web Convex app will sometimes become unresponsive. I notice it mainly when opening my phone and trying to use the app like I did before I turned it off. For simplicity sake lets say I have a button that runs a counter mutation. The button will just not work and I feel like it's because the websocket disconnected while my phone was off and hasn't reconnected. Refreshing the webpage will make everything work again. What's the pattern here because this is kind of a show stopper. My users won't know why the button isn't working or why and having them have to refresh the page is a weird workaround....

How to handle Authentication for preloadQuery on the cleint (Better Auth)

I am using Better auth setup with convex in nextjs app router like this. To have user info on the client prefetched ```ts import { api } from '$convex/_generated/api';...