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

Big dataset not in filter

I have asked about this topic before but there are things I can't figure out. I am setting up a structure similar to tinder. I keep the reactions of the users and the user id they reacted to in a table. My flow is working now but it is obvious that it will have problems with large data. (We can think of a scenario where 1 user has 100 thousand reactions and the total number of profiles is 1 million)....

Is Convex websockets down?

I'm not sure if it is just me and whether this is the right channel to report this, but I all my requests are taking an extremely long time to load over the typical websocket connection. I've tried this out on 3 separate apps and they are all showing the same symptoms - stuck in the loading state. getting a number of these errors from a UI that I can inspect. also for context, I reside in Singapore so am accessing it from here....
No description

How to aggregate documents (more than 16K)?

Hi, I know aggregations, joins, etc may not be the most performance queries but something the developer have no other option. How can I count all the documents of a table? Also, I need to count the documents by month, for example: All the invoices per year, per month, per week, etc. I would not like to export to elasticsearch because would make me lose the realtime capabilities....
No description

Race conditions with single use refresh tokens for Convex Auth

I'm trying to prototype refreshing Convex Auth tokens from my backend, to support server side rendering and data fetching. I'm able to do this by setting cookies instead of use local storage, but am struggling to avoid race conditions for the refresh token. There a few differen scenarious where multiple requests come it at the same time onto different servers. The servers notice the JWT is about to expire (I'm faking 10 seconds expire) and then call the signIn action with the refresh token. This often causes the user to log out because (I believe) the second refresh fails due to reusing the refresh token quickly. I've tried deduping the refresh calls, but this is not straightforward with multiple requests/servers/reloads so it's still flaky. Two questions: 1. Is it correct that the refresh token can only be used once, with no buffer in time?...

How to handle call-back in convex ?

Essentially trying to achieve: app.get("/callback", async (req, res) => { const { a, b } = req.query; }...

ES Module support

Hey guys! Wonder if Convex supports es module packages like lodash-es

convex auth: you can only send testing emails to your own account??

Can someone help out how do i overcome this ? I definitely need to test different account sign in on development because the app im using will involve multiple user (collab feature)...
No description

[Convex Auth]: convexAuth() causes "Type instantiation is excessively deep and possibly infinite."

We get the Type instantiation is excessively deep and possibly infinite. error on our api object whenever we export our Convex auth stuff from auth.ts, e.g. with this simple example: ``` import { convexAuth } from '@convex-dev/auth/server'; import { Password } from '@convex-dev/auth/providers/Password';...

neq condition for `withIndex`

here are pseudocodes that fails to compile: ```ts ctx.db .query('inventory') .withIndex('by_status', (q) => q.neq('status', 'removed')) // in_stock, sold, removed...

Tanstack + Realtime not working

I'm using tanstack query and I'm not getting updates until I refresh the page Is there anything obvious I'm doing wrong? This pattern was adapted from the example on the tanstack website https://tanstack.com/router/v1/docs/framework/react/examples/start-convex-trellaux Here's the project table...

i had to calculate data from db. and i ended up using pagination with mutation. fallbacks ?

convex export const getAllDataWithDetails = mutation({ args: { paginationOpts: paginationOptsValidator, filterType: v.string() }, handler: async (ctx, args) => { const { filterType, paginationOpts } = args;...

Cannot get current user

I try to retrieve the data from current User to start to create a post, but I cannot retrieve the data somehow. I did the authentication with Clerk but did copy the data to Convex database, somehow it still cannot see the currentUser....
No description

Do i have to re-write the validation again ??

i've been using this convex saas template and found this piece of code, the two thing is basically the same thing. I tried to refactor the mutation using schema.table.subscriptions.validator. The function compiles fine in the cloud, however when running the function im getting this error where my validator is just an empty object.
No description

vectorsearch by filter fields is not working?

I have following definition of vector index: .vectorIndex("by_embedding", { vectorField: "profileEmbedding", dimensions: 3072, filterFields: ["user", "isOpenToWork", "geo", "summary", "headline"]...

Convex Cursor docs

I came across this while searching for how to pass convex docs to cursor. Is there a guide somewhere on how to use with with Cursor docs feature? https://github.com/get-convex/convex-search-indexer/blob/main/convex/docs.ts...

Programmatically creating cron jobs

I've been attempting to programmatically set up cron jobs for different users with different cron expressions, calling them via actions and mutations but with no luck. It seems scouring other docs and other peoples questions that this isn't currently possible or even considered an anti-pattern. I'm not sure how to implement my use case just using scheduled functions. My current implementation: ```...

How to resolve "use platform: node" error when compiling a node package?

The exact error is: The package "https" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error. Bit new to node, so not sure where exactly to include this setting. Any help would be greatly appreciated !...

Pagination with preloaded data

My main question is How to preload data with usePaginatedQuery
And i also want to ask... is this possible in Convex : Cursor-based pagination: allowing me to jump to a specific page using a cursor token Offset-based pagination...?...

Convex Auth with OTPs for React-Native with Expo error with verificationRequest

```Android Bundled 61ms node_modules/expo-router/entry.js (1 module) ERROR [CONVEX A(auth:signIn)] [Request ID: 028a44069ad9e8f7] Server Error Uncaught Error: Could not send at sendVerificationRequest [as sendVerificationRequest] (../../convex/ResendOTP.ts:22:4) at async handleEmailAndPhoneProvider (../../node_modules/@convex-dev/auth/dist/server/implementation/signIn.js:77:23)...

Convex Auth getUserIdentity() returns object without email

I have 2 applications: a nextjs and a react native expo app. The nextjs app uses the new convex auth lib for authentication while the expo app uses clerk. I am observing that when auth.getUserIndentity() is called from expo (in other word called within a function called from expo), it returns a user object with all keys: user name, phoneNmber, emailVerified...etc...