Mordsith
Explore posts from serversCCConvex Community
•Created by Mordsith on 4/16/2025 in #support-community
Add a query filter for empty value
This is a proposal to make querying for empty values easier. Handling all possible edge cases
There should be a query filter to handle possible empty values; in situations where we need to
unset
a property and filter by this property, this filter should consider all possible falsey value, something similar to lodash's isEmpty
https://lodash.com/docs/4.17.15#isEmpty
This may be opionionated but I think there are a few people who see value in this...
For array types => []
For object => {}
For string "" (not to be confused with " ", an empty space; We can consider both instance as falsey
but I need to hear people's suggestions if this makes sense)
For numbers => 0
It should also apply to null
, undefined
and NaN
Instead of doing things like this
This new approach is cleaner and would automatically handle edge cases. When the field is an object
and this object is empty, it returns as part of the results; for an array, when it's empty or the length is 0, this also applies; same with null
, undefined
, false
and 0
Open to questions and why this may not be a good thing.
More: https://developer.mozilla.org/en-US/docs/Glossary/Falsy2 replies
CCConvex Community
•Created by Mordsith on 3/3/2025 in #support-community
Error: Unable to start push

7 replies
CCConvex Community
•Created by Mordsith on 1/20/2025 in #support-community
Debug Internal Node Errors

4 replies
CCConvex Community
•Created by Mordsith on 9/28/2024 in #support-community
Type inference issue with newly added routes

5 replies
CCConvex Community
•Created by Mordsith on 9/28/2024 in #support-community
Custom query with default argument
I want to write a custom query that adds a default argument.
I would like to add an
organizationId
argument to this custom query so that every consumer of this custom query won't need an organizationId
in the query args.
I'm trying to achieve this to avoid the repeated organizationId
in the args param
I got this working using another approach but I'll like to know if this can be done directly with customQuery
5 replies
CCConvex Community
•Created by Mordsith on 9/20/2024 in #support-community
Convex Auth Typescript Error with Vercel

9 replies
CCConvex Community
•Created by Mordsith on 8/6/2024 in #support-community
Conex Auth fatal error

4 replies
CCConvex Community
•Created by Mordsith on 8/3/2024 in #support-community
Convex Auth e2e test with Playwright
I currently use the Email OTP provider, I couldn't figure a way to get verification code within the test environment without exposing this code somewhere in memory that is globally available but unsafe.
Migrating from Clerk, Clerk solved this by doing 2 things
- Every email login with
clerk_test
in the email is treated as a fake user.... For example [email protected]
- Every user with that kind of email address can verify auth with 424242
(This code works for only users with clerk_test
in their email
As a fallback, I switched to using Anonymous Provider for test envoronment but it would be beneficial if we can test actual authentication flow like a real user.
@Michal Srb1 replies
CCConvex Community
•Created by Mordsith on 7/12/2024 in #support-community
import.meta in Convex

2 replies
CCConvex Community
•Created by Mordsith on 7/6/2024 in #support-community
ConvexTest setup error

5 replies
CCConvex Community
•Created by Mordsith on 7/2/2024 in #support-community
Schedulers with priority
It would be nice if the schedulers can have a priority to control how functions are executed.
In my scenario, I'm consumin a Webhook from Microsoft Azure that calls my convex route which triggers a scheduled function (rate Limited / 1minute).
There were 10 failed webhooks, the 3rd party provider keeps retrying the failed webhook when a new request comes in.
For example, a new user makes a request, expected to receive a result in 1minute (rateLimit), however, the provider automatically retries the previous webhooks that failed in random order. Each of this run waits for 1minute thereby making the new user wait 10 minute before his request is processed.
If there was a way to prioritize the scheduler + rateLimit,
HIGH
, LOW
, MEDIUM
or something close so that even when we have 100 items scheduled to run, it starts with functions with HIGH
priorities first, assuming the failed request was set with LOW
priority.
With this in place, failed webhooks won't stall results for new users as they'll be processed later.7 replies
CCConvex Community
•Created by Mordsith on 6/19/2024 in #support-community
Database seed with 70,000 items
I've been trying to get past this error:
You have an outstanding query call. Operations should be awaited or they might not run. Not awaiting promises might result in unexpected failures. See https://docs.convex.dev/functions/actions#dangling-promises for more information.
This is my code, I've tried writing it in many ways
I have a npm script that seeds data into a database, this seed is an internal action that is meant to fetch a JSON response from an external source, the size of the JSON response is approximately 7MB.
When this action runs, I want to run a mutation that adds each of the item to a table. I'm not able to get past this issue with Promises.31 replies
CCConvex Community
•Created by Mordsith on 6/6/2024 in #support-community
Handling Rate Limits with Convex Scheduler
If I were to mirror a queue that runs exactly like a setInterval, how do I do that?
Scenario. I want to call a third-party service that has a 1req per minute rate limit. With most queue workers, using a simple configuration, you can specify that you want the worker to run jobs every 1 minute to beat the rate-limiting problem. If 10,000 users make a request at once, no problem since all this will be in the queue and the worker will process it every minute.
Hw do I configure a scheduler to work this way? Imagine 10, 000 users would hit the function to be scheduled. I want to process this using FIFO at set intervals
9 replies
CCConvex Community
•Created by Mordsith on 5/8/2024 in #support-community
Sort paginated items
I have this schema
I want to query like this but give the users ability to sort in ascending / descending order based on the
searchable
index.
When I replace:
with:
sort works as expected but I can't use multiple index, I need to use the existing index while allowing users to sort based on the searchable
field2 replies
CCConvex Community
•Created by Mordsith on 4/30/2024 in #support-community
Use jsx-email within convex

7 replies
CCConvex Community
•Created by Mordsith on 3/13/2024 in #support-community
Authentication Error and SSR with Next.JS

4 replies
CCConvex Community
•Created by Mordsith on 2/22/2024 in #support-community
IndexNamesNotUnique
All my tables have unique index names but I get this error when I try to
dev
7 replies
TTCTheo's Typesafe Cult
•Created by Mordsith on 11/26/2023 in #questions
Next.JS Background Tasks
I need help with something driving me crazy. This is a Next.Js problem not an uploadthing problem but I’m curious if anyone has ever faced this issue with Next.JS instrumentation.
I have a
upload-thing.js
file that handles file uploads. This file has import server-only
at the top.
I have 3 long running tasks to perform after successful upload, I decided to introduce a Queue to my setup. I used BullMQ library. The queue and worker files are all part of the Next.JS application.
THE CHALLENGE: I need to start the Queue worker somewhere, somehow. This queue worker is a function I need to call once, preferably during boot.
THE PROBLEM: Server fails to start apparently because the “parent component” is a client component. This parent component happens to be the instrumentation.ts file that imports the file that contains the “import server-only” line.8 replies