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

How does the convex dashboard animate data change?

When we update the document in convex dashboard, the dashboard is able to animate the changed cell. and this works across all clients. How is it able to detect a data change (assuming the dashboard uses convex as the backend)

Notification System Design Advice

I'm developing a notification system for a prelaunch startup and would like some advice on how to implement this using Convex. After some research, I've noticed that most companies have a complex microservice architecture for this task. They implement many different types of notifications (SMS, Push, Email, etc.) using event-driven architecture. Popular technologies such as Apache Kafka and RabbitMQ are used for message events. I have attached a diagram of my system design draft v1 for direct messages using email notifications. My goal is to make a notification system that relies on outside services as little as possible and utilizes Convex to the fullest. I'm also thinking of expanding this system and supporting multiple different types of notifications as the needs of the product grow. If you have any advice that would be greatly appreciated....
No description

getUserIdentity returns null in Expo Clerk (Android)

I have a react native expo application and I use convex with clerk for authentication. The getUserIdentity is returning null when called in a server function. This behaviour occurs only when the client is android. This behaviour does not occur with an IOS device (iphone). This is how I make the call in a server function: ```...

"Connection lost while action was in flight" Error

Hi all, I'm having an issue with handling large API responses in Convex. The endpoint returns responses up to 150MB in size. The request works fine via curl, but fails when i run the action from the Convex console with: "Connection lost while action was in flight" Would appreciate any guidance on best practices for handling large API responses in Convex, or alternative approaches. Thanks...

Too many bytes read in a single function execution in migration

Hi, I am trying to run a migration on a table. When docs come in in the migrateOne function, i get the above error. How can I possibly deal with my docs if I can't load a single doc in a query?

Looping over tables with normalizeId?

I've looked all over at posted examples of normalizeId and all related posts and i can't figure out if there is any other way to get a proper runtime tableName that isn't saved in the db. Is there any real downside to this, no performance hit right? When looping through say 10 tables for the one that might have the id. I'd like to be clear what all the options are. I know ents doesn't have ctx.db.get(id) but i havent seen that done either. ...

Multiple monorepo app deployments using the same convex backend?

What is the general consensus about this in production? If its doable then what are the possible downsides? Assuming we have several apps deployed all using the same backend, i'm worried if one deploy fails while the other builds and updates the database the version mismatch. We do plan to track code versions and db versions eventually anyway which could have safeguards....

Unable to Vercel Deploy to Prod with Vite React and Convex Auth

Hi Convex support team! I’ve been building a project with Convex and Vite with Convex Auth (Resend) that is working great locally, but I have been running into issues in trying to deploy to Prod with Vercel. Can someone please help me understand: 1. What are the Vercel environment variables that are needed? Is it just the Convex Prod Deployment Key? Or do I also need to specify the Convex URL eg -donkey-88…? 2. What are the Convex Prod environment variables needed? I currently have the Resend API Key there. Is that correct? Anything else needed eg for my OpenAI calls in my app? ...

Animating database updates

Lets say I want to mutate data , lets say i have a list of items. I want to animate the deletion of an item in the list or animat ethe addition of an item. How would this be done in react? Is there a way to hook into database updates from the client side?...

VSCode keeps showing an error on functional Convex API Call

Hi! My issue is that in my Convex database, I have a table called submissions.ts and the table name in the schema.ts file is also submissions. Thus, when using the API call, I also use api.submissions, which is correct, but VSCode keeps wanting me to switch to api.submission, which is wrong (and if I change to it, the code stops working, which makes sense). How should I address this issue? Is there anything in particular I'm doing wrong with the IDE that is making this an issue? Thank you!...
No description

getUserIdentity returning null + ui errors, convex clerk

Hi, I am trying out Convex + Clerk for first time. I used these docs. https://docs.convex.dev/auth/clerk#user-information-in-functions I am using https.ts in convex with webhook in clerk for sycning users in clerk & convex which seems to be working correctly. ...
No description

Clerk auth v6 integration with Convex provider in Nextjs

So v6 of clerk is out and it gives us the ability to wrap individual components with the clerk provider and pass the dynamic prop to get server side auth. Currently the convex provider requires us to wrap the entire root and wrap that in a dynamic clerk provider causing all pages to be dynamic and rerender on each request… Is there any plans to change how the convex provider works with clerk? It would be nice to take advantage of nextjs ppr and other static rendering methods of pages that don’t require server side auth....
No description

Creating an API Key for Secure Data Access Between Next.js Server and Convex Backend

Hey everyone! 👋 I'm working on a project where I have a Next.js server and a Convex backend. I want my server to access specific data from Convex without needing to set up a user account or similar authentication method on the backend. Ideally, I'd like to create an API key that my Next.js server could use to access this data securely. My Goals:...

npx convex deploy does not send my dev data including files to production

Why does running npx convex deploy not send over my tables from my dev instance and files to the production instance?

Mutation error: `Returned promise will never resolve` caused by triggers

I've never seen this error before, and when i get rid of this trigger in my blocks mutation it goes away... The original mutation contains some promise all statements that insert docs into the blocks table Any ideas?...

Errors importing dayjs plugins

Hi, I have a file in convex/utils/dateToMs that I need to parse incoming dates in different formats. It requires the use of dayjs and some of it's plugins. The code seems to push successfully when just importing dayjs but the plugins are throwing an error: ``` import dayjs from "dayjs"; import customParseFormat from "dayjs/plugin/customParseFormat";...

ConvexQueryCacheProvider Behavior

I switched to using ConvexQueryCacheProvider in order to keep query subscriptions active for views that are closed and opened frequently. I get nice instant load times now on the screens/components I use it on. But if I check the network tab in chrome I’m seeing a request to the server going out every single time the page/components loads. Part of my goal was to freely call the cache without re-calling the convex server for data every single time. Am I doing something wrong or is this intended behavior?...

Text Search is hard to use

Two pieces of feedback: 1. The docs don't teach useStableValue or (less good imo) useStableQuery, don't link to https://stack.convex.dev/help-my-app-is-overreacting (which is long though), so creating a search interface is not straightforward without results flickering. 2. Now that search changed from prefix to fuzzy, it no longer fits super well the use case of looking up people by name (or room by name etc.), because irrelevant results are still returned. This could be alleviated (even if it's not the ideal fix) if the docs gave a recipe for computing the relevance score on the client side (or some measures resembling the relevance score)....

Resend, Email verification/login not working?

```log Enter email in form and submit [verbose] 2024-10-29T22:57:48.222Z [ConvexAuthNextjs] Begin middleware for request with URL http://localhost:3000/api/auth [verbose] 2024-10-29T22:57:48.222Z [ConvexAuthNextjs] Proxying auth action to Convex, path matches /api/auth with or without trailing slash [verbose] 2024-10-29T22:57:48.223Z [ConvexAuthNextjs] Fetching action auth:signIn with args {"provider":"resend","params":{"email":"Nlaakald@gmail.com"}}...

Uncaught Error: The arguments to a Convex function must be an object. Received: skip

Using convex-react-query, I noticed there is a new skip arguments that can be used to disable a query when the arguments is not available yet. But I get this error: Uncaught Error: The arguments to a Convex function must be an object. Received: skip. Which means the convex client complaining about the args. Looked at the code and normally the query shouldn't run at all. Any idea? Maybe I understand it wrong. My code: ```typescript export function useGetDocument() {...