Importing a snapshot during deploy stored on s3
Hi, my snapshot is now above 100mb. This means I can no longer commit it to github. Is there a way to tell the deploy command
npx convex import --preview-name "$VERCEL_GIT_COMMIT_REF" ./data/mock-data/snapshot.zip
during a deploy to tell it to grab the file from a remote resource, like an s3 bucket? What are workarounds for large snapshots that can't be commited to a repo?Disable useQuery hook
Hello, I'm experiencing an issue with the Convex useQuery hook. Is it possible to disable it entirely? For instance, I've tried:
```tsx
const disabled= ///////
const results = useQuery(api.hire_requests.notifications, { disabled });...
Mapping defined types to other defined types
I have two types:
```
export const ReferralOverviewStatus = v.union(
v.literal("new"),...
Can't run: npx convex dev
I'm working in my personal project with nextjs 14. I successfully integrated the convex to my project and i tried convex with sampleData.jsonl but when i tried to go with convex auth setup and run npx convex dev, its shows couples of errors
Object contains extra field that is not in the validator.
I get this error. ArgumentValidationError: Object contains extra field
example
that is not in the validator.
How to allow pass args that have unknown args and make the validator just ignore them but make sure what is requested is in there?
Looked at the docs and couldn't find an example....Validate a user during the auth step
I'm working on a personal app (i.e. nobody else should use it but me), and the easiest way I could think of to launch it is to deploy it online (e.g. Vercel) and use auth to prevent anyone but me from using it.
I added Convex Auth to the app code yesterday, configured to use GitHub, and that part works fine. Once the auth phase is complete, I can look at the user details, see whether or not it's me, and just not render anything if it's some other GitHub user. However, is there a way to restrict any other GitHub user from even completing the auth phase? For example, GitHub verifies that someone has a GitHub account, but compares that against a list that I provide to only allow select users (e.g. me) to complete the rest of the auth.
I'm likely going to face a similar challenge in the future when adding auth to an app that I'll be creating for work. It should only be usable by company employees, and the company emails are all run through a Google workspace, so I was thinking of using Google auth to verify our users and only allow those with emails from our workspace/domain to access the app. However, I have a similar question about a mid-phase verification. For example, the Google auth page loads and a user picks their Google account that they'd like to use to log in. What I'd ideally like to do is prevent the password entry from even appearing if their email isn't on our domain....
getting compile TS error after upgrading to v1.16.2
Hi all,
I tried to upgrade the convex dependency from v1.16.0 but both newer versions 1.16.1 and 1.16.2 throws this weird export error when running codegen or dev commands.
I scanned my convex directory and I don't see any warnings or errors from eslint....
Can't correctly type fields from a table to my NextTS application
This is more of a pure TS question than Convex, but at least it originates from the types of one of my convex function definitions. I'm getting this type error when trying to
build
my project (been fixing them by the dozens as we get ready for deployment) : ```Type error: Type 'ReactMutation<FunctionReference<"mutation", "public", { id: Id<"documents">; orgId: string | null; storageId: Id<"_storage">; }, null, string | undefined>>' is not assignable to type '(params: { id: XOR<Id<"documents">, Id<"vendors">, Id<"contracts">, Id<"riskAssessments">>; orgId?: string | null | undefined; storageId?: string | undefined; }) => Promise<...>'.
Types of parameters 'args' and 'params' are incompatible.
Type '{ id: XOR<Id<"documents">, Id<"vendors">, Id<"contracts">, Id<"riskAssessments">>; orgId?: string | null | undefined; storageId?: string | undefined; }' is not assignable to type '{ id: Id<"documents">; orgId: string | null; storageId: Id<"_storage">; }'.
Types of property 'id' are incompatible.
Type 'XOR<Id<"documents">, Id<"vendors">, Id<"contracts">, Id<"riskAssessments">>' is not assignable to type 'Id<"documents">'....Snapshot import without ID
Hey I'm trying to import a snapshot export from my prod deployment into my dev deployment and am getting the following error . Is there a quick way to get around this?...
Hit an error while importing:
New table departments has IDs that conflict with existing internal table. Consider importing this table without `_id` fields or import into a new deployment
Hit an error while importing:
New table departments has IDs that conflict with existing internal table. Consider importing this table without `_id` fields or import into a new deployment
Recomended way for Case Insensitive Index or SearchIndex
Say for a table "users" with a field username, What is the recomended way to query for records matching username(in case insensitive way) ?
We want to preserve the case the username was chosen by the user but the same username should not be taken by others....
How to integrate auth on Svelte?
Hello, i was looking into convex auth but it seems it only supports react.
What's the next best alternative? Any tutorial or repo that shows an example integration?
Thanks...
I have cloned the convex-auth-example chat app
There is one problem, while running locally, I can't sign in with a password, at first it shows there is no JWT_PRIVATE_KEY but the data is stored in the database. Then I added ...
JWT_PRIVATE_KEY
in .env
at convex. Now if I sign in with a password, it shows this error,
SignInWithPassword.tsx:32 Error: [CONVEX A(auth:signIn)] [Request ID: f6fe557261498] Server Error
Uncaught Error: Uncaught TypeError: "pkcs8" must be PKCS#8 formatted string
SignInWithPassword.tsx:32 Error: [CONVEX A(auth:signIn)] [Request ID: f6fe557261498] Server Error
Uncaught Error: Uncaught TypeError: "pkcs8" must be PKCS#8 formatted string
Custom Convex Domain
When using a custom convex domain, is the project id obfenscated away from the end user? like is that project id embedded in any type of websocket event that someone could get to then use to hit my convex storage if they wanted?
Updated the dependency in convex-auth-example
Hi guys!! I’ve been exploring Convex for the past two days and convex made an example project chat application to showcase auth. However, when I tried to run it locally, I encountered an issue because the
npm-run-all
command dependency was missing. so I fixed it and made PR.
https://github.com/get-convex/convex-auth-example/tree/main
Unfortunately, I received a message indicating that all checks have failed, and it shows:
```...Discord OAuth reauthorization
Hey all,
I've successfully set up convex-auth in my project and in the process of hooking up the OAuth providers. GitHub seems to be working fine, however, Discord is making me reauthorize myself everytime I log out.
According to the Discord docs, we need to pass in
prompt=none
to the Authorization URL (https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-authorization-url-example)...Get all documents where storageId not null
How would I achieve this query? I have a table with an index on an optional storageId field, but when doing the withIndex I can't seem to pass gte('file', undefined)
Optimizing Function Calls by Avoiding Redundant Abstractions
The problem I’m facing is that I’m using an extra layer of abstraction in my code that doesn’t seem necessary. I have a function called
getCurrentUserInternal
, which is basically just a wrapper around another function called getCurrentUser
. I’m using this wrapper to access user information inside another function, getFacturapiLiveInstance
.
The problem is that getCurrentUser accepts QueryCtx, and in the action I only have access to ActionCtx.
Is there a better way?
...`default()` on Convex validators
.parse()
and .default()
are some of my favorite features of Zod validators, and it would be really great to not have to think about doing z.parse() before writing something to Convex and that Convex could automatically apply defaults specified in the schema.
Is this on the roadmap?...