djbalin
CCConvex Community
•Created by djbalin on 12/19/2024 in #support-community
[Backup & restore]: Force overwrite
Would it be possible to add this to the web interface restore? Maybe this could be made an option only for dev environments to avoid doing something nasty.
We back up our prod deployment, and sometimes I would like to overwrite my dev deployment with such a backup, but must manually clear all tables first to avoid this error:
4 replies
CCConvex Community
•Created by djbalin on 12/18/2024 in #support-community
Calling `ctx.runQuery` from `query`
I seem to have my world shaken by Convex almost every day (in a good way)! I always thought
ctx.runQuery/runMutation
was only possible from actions, and that calling a query from within a query was not possible, but that regular TS helper functions should be employed (e.g. as @erquhart mentions here https://discord.com/channels/1019350475847499849/1216003221445939330/1216033039247867984).
I just found out that it is indeed possible by just using ctx.runQuery
. That comes with this warning/info: often you can call the query's function directly? Is this what you mean/propose?:
4 replies
CCConvex Community
•Created by djbalin on 12/5/2024 in #support-community
Union schema: no type inference?
3 replies
CCConvex Community
•Created by djbalin on 12/4/2024 in #support-community
Ignoring _generated in pull requests/git diff
Hey, does anybody know how to do this? It's suggested to not gitignore the
_generated
files for CI/CD reasons (and we concur with this), but we would still like to not have the files show up in our diffs for pull requests.
We tried putting the belowin a .gitattributes
file, but seems like that doesnt apply to github pull requests.
Anybody have some advice for this? Thanks! 🇩🇰
7 replies
CCConvex Community
•Created by djbalin on 11/29/2024 in #support-community
Bandwidth usage multiplied by piping arguments?
Hellooo!
I noticed that one of my daily cron jobs is incurring rater high bandwidth usage. We have a video streaming app, and this cron job collects all watch events within the past 24 hours (using the _creationTime index) and populates three aggregates with these documents.
My specific question is this: Let's say I query 1 MB worth of data and call four functions with this as an argument:
Would this already incur +4 MB of bandwidth usage? As far as I can tell, objects are passed by reference as arguments to functions in JS, so I suppose not? What if instead of regular JS functions, I schedule/run four Convex functions:
5 replies
CCConvex Community
•Created by djbalin on 9/23/2024 in #support-community
Control Convex env variables output location
4 replies
CCConvex Community
•Created by djbalin on 9/9/2024 in #support-community
[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:
If we remove export
from the above (such that it does not occur in our Convex generated files), our api
type instantiation is not excessively deep.3 replies
CCConvex Community
•Created by djbalin on 8/27/2024 in #support-community
[Convex Auth]: signIn doesn't set isAuthenticated to true immediately
Hi, as the title suggests,
signIn
doesn't seem to set isAuthenticated
immediately after the resolution of its promise.
For example, this snippet of our AuthProvider:
We have isAuthenticated
as false even after awaiting the successful signIn
. This causes our redirection to mess up, since when isLoading
resolves to false
, isAuthenticated
is also still false
despite the user having just logged in.
This doesn't seem intentional - after successful signIn
, the next {isLoading, isAuthenticated}
pair should resolve to a truthy authentication status, no?
Thank you 🙂6 replies
CCConvex Community
•Created by djbalin on 8/9/2024 in #support-community
[Convex Auth]: automatic clean-up when deleting user/authAccount?
Hi, does Convex Auth ship with a deleteUser/deleteAuthAccount functionality that automatically cleans up related documents in all the automatically generated tables such as
authSessions
, authVerificationCodes
, authRefreshTokens
etc? 🙂
I couldn't find find it in the implementation, and I suppose you leave this functionality out to allow us full control over it, but maybe a "starter" would be nice that cleans up orphaned documents in the automatically created tables 🙂2 replies
CCConvex Community
•Created by djbalin on 8/3/2024 in #support-community
[Module: server/TS]: Generic query pipelining
5 replies
CCConvex Community
•Created by djbalin on 7/31/2024 in #support-community
[Convex Auth]: Monorepo Expo app: "Unable to resolve @convex-dev/auth/server" ...
Hi, we're building a Turbo Monorepo Expo app and are running into the error pasted below when running the Expo dev server from our native package. The error occurs during bundling when we try to open our iOS app.
Our native app in
apps/native/package.json
has a dependency on packages/backend
as "@flimmer/backend": "*",
The iOS device error gives this information:
Thank you!8 replies
CCConvex Community
•Created by djbalin on 7/29/2024 in #support-community
Strange Doc type/inference: "[x: string]: any;, _id: Id<string>;"
Hi, we've been running into this strange problem a few different places in our repo by now and can't quite seem to figure out what's going on.
Basically, sometimes, the type returned by a
Doc<TableName>
returns this strange thing:
We're in an expo/Next monorepo, and seems to work fine when inside our backend package (where Convex is), but not when we are in our native/web packages (even though we just import Doc
from the generated files)2 replies
CCConvex Community
•Created by djbalin on 7/26/2024 in #support-community
Convex Auth: Error types for signUp/signIn
Hi, is there a way to know the possible types of errors that the signUp / signIn functions can throw? I want to disambiguate between error causes on the frontend.
Specifically, I want to do something like:
3 replies
CCConvex Community
•Created by djbalin on 7/25/2024 in #support-community
Convex Auth: Invalid key provided to SecureStore
Hi, I am facing a bug while using the otherwise great new Convex Auth library.
I have followed the setup instructions in https://labs.convex.dev/auth/setup#add-authentication-tables-to-your-schema for my React Native app, and while the signUp flow seems to work (a user document gets created in my database), I get the following error regarding the SecureStore in my frontend:
Since the library is handling setting and reading these keys, I find it hard to debug, and have not found a solution in the documentation, here, or online.
Here is my Convex provider:
3 replies
CCConvex Community
•Created by djbalin on 6/25/2024 in #support-community
useQuery vs one-off query (performance, open connections, etc.)
Hello everyone. I've been thinking about the benefits/tradeoffs of useQuery vs. the imperative/one-off query (https://docs.convex.dev/client/react#one-off-queries) and would love some input.
Basically: what are the performance downsides to using useQuery? Does a useQuery e.g. maintain an open network connection throughout the lifetime of its parent component? Is it better/"safer" to default to one-off queries and only opting in to useQuery when we truly need/want e.g. the reactivity or "undefined" loading state that it provides?
I am asking specifically in the context of a mobile app using tab navigation: When we navigate from screen to screen using the navigation bar, the non-focused screens/components do not unmount but are kept alive in the background. I was therefore considering if absent-mindedly using useQuery in all these screens would/could lead to a lot of unnecessary open connections and/or overhead.
Thank you!
6 replies