Convex Community

CC

Convex Community

Join the community to ask questions about Convex Community and get answers from other members.

Join

support-community

show-and-tell

general

self-hosted

announcements

Send params from signIn to sendVerificationRequest using ResendOTP

Hello team! I'm trying to pass the language of the user when he signs in to the app so that I can send the verification OTP email in that language. I'm not finding a way to do it....

Unable to access identity from ctx.auth.getUserIdentity in HTTP action

Hi team, I'm trying to secure my image upload HTTP action and currently call the action via a hook. I'm using Clerk for auth and was able to confirm that calling useAuth() then awaiting the getToken function returns a JWT token. When I pass this token in as an Authorization header to my call to my HTTP action and then call ctx.auth.getUserIdentity() within the action, I keep seeing null. Any ideas what may be going on here? Thanks!...

aggregate index

export const pageDelete = query({ args: { index: v.number(), pageSize: v.number() },...

Infinite Scrolling with TanStack Query & Convex – Is It Possible?

Guys, is it possible to use TanStack Query with Convex for pagination (specifically for infinite scrolling)? Can I get an example repo to look at or some documentation links? Thank you so much!
No description

middleware is slowing down NextJS page render

after few hours of debugging, i finally figured out why my Next app page navigation is slow (doesnt instantly navigate when clicking <Link/>). It was the convexAuth.isAuthneticated() function is triggered on every page navigation. I know it was the function because when i remove the line, my page navigates to the new path instantly and i dont have that auth:isAuthenticated log in convex. so the question is how do i optimize it ??...
No description

Mapping telegram user ids to Convex users

is there a way to just tell Convex "this user is authenticated" and then call the actions and have ctx.auth.getUserIdentity() return the user? I have a use case for telegram bot where I am looking up user by their telegram user id and then calling the actions that depend on ctx.auth.getUserIdentity(). I want to avoid the need to pass telegram user id to the convex actions and want to have the same experience for telegram users as a user calling via convex react client....

is there a way to see my database usage??

currently i can only see the usage/metrics when im in danger of over using it on my current plan. Can i see it so i can plan for the future ?

ConvexQueryCacheProvider in Expo?

I'm adding the following import to my Expo app: import { ConvexQueryCacheProvider } from 'convex-helpers/react/cache/provider'; and wrapping the app with <ConvexQueryCacheProvider> But somehow I still get the error message saying that this provider is missing. I'm wondering if this is supposed to work in RN/Expo?...

`.unique()`: Better error logging

Could the Convex error log Uncaught Error: unique() query returned more than one result indicate the id of a document found not to be unique? Would help us in easily identifying and correcting erroneous data! 🙂

Bug in httpAction, Authorization Bearer not working. Identity is null

Hello, im having the same trouble with auth through an http action On the documentation https://docs.convex.dev/auth/functions-auth#http-actions it says that if I put an Authorization token then ctx.auth.getUserIndentity should return the user, however this is broken. ...

Duplicate a File

I am trying to copying an Entity in the DB, which has a file associated to it to another user. So when a user tried to duplicate an entity, I need to: 1. Copy entity to the new user 2. If there is a file attached to it, duplicate it and attach to the new Entity created. I could not figure out how to duplicate an existing file in Convex. Any idea?...

Are there any plans for optimistic updates by default?

Hello community. I have just migrated my app from Firebase and see that all mutations are pessimistic by default in convex. This was not expected. It breaks UX in many places, like drag and drop and even droplists. Is there a reason for the default "pessimism" in Convex philosophy? Is there, by any chance, a plan to have configuration in the future to make all mutations optimistic by default? I love Convex and feel it's a dream product, but the requirements for verbose optimism make me think of...

aggrea

I kept getting the below error Math that I believed should always end up with an integer was sometimes not, I am still not sure if its a weird floating point thing or an actual mistake in my logic but either way casting to an int eliminated the error const int_index = Math.floor((page - 1) * pageSize); const { key } = await timeline_aggregate.at(ctx, int_index);...

Are immediately scheduled functions FIFO?

i.e. if I write ``` export const doLotsOfThings = internalMutation({ args: {}, handler: async (ctx) => {...

Making useQueries more type-safe

Small suggestion, change ```ts export type RequestForQueries = Record< string,...

Unconventional Authentication Implementation

I have an interesting client and one of his specifications is that he wants to keep users of the platform completely anonymous, but we still need a way to identify them, but without knowing their personal details. So he wants to use phone numbers to authenticate them and they encrypt the phone number in the database I don't really know how to go about implementing this with convex. The 2 ideas I have are: 1. To use the Lucia implementation to create a custom auth flow - but lucia is deprecated so I have to find the equivalent....

Http Action no authentication

```js export const generateUrlForToken = httpAction(async (ctx, request)=>{ const identity = await ctx.auth.getUserIdentity();
if(identity == null){...

useAuthToken hook is not working with Auth0. it returns null

```js <Auth0Provider domain="redacted" clientId="redacted" authorizationParams={{...

SwiftUI with Convex and Clerk problem :

in my app, I'm integrating Convex with Clerk auth, in my swiftUI ios app. Before signing in, I have no problems talking to the Convex Backend. I did all the steps. When I sign in, I print the auth state in the xcode logs, which says authenticated - with the JWT....

Offset-based pagination returns NULL

I'm trying to implement offset-based pagination however almost every query returns null. Random access works fine. Getting the total count gives me a number greater than the number of records in the table. I've "repaired" my aggregates. Setting the offset to a high value sometimes returns a result but seems to be a random field from the record.