CodingWithJamal
CCConvex Community
•Created by CodingWithJamal on 11/15/2024 in #support-community
How to handle the elapse of time for debounce logic in Convex?
I’m building the notification logic for direct messaging. My app is prelaunch, and I want to keep the notification logic simple for the MVP. For now, the logic should be based on data that's simple to gather, e.g. debounce time and read receipts. In the future, we may add more factors for the logic, e.g. user presence. And more notification types, e.g. native in-app notifications.
The key challenge I’m facing in Convex is managing time-based logic to debounce email notifications. Ideally, the app delays notifications for a short period in order to group multiple messages into a single email.
Below are my current potential approaches for debouncing. Which do you recommend?
A) Convex actions to handle server-side logic for delayed email sending. My concern is whether actions are the right tool for managing time-based workflows and how they interact with Convex’s persistence model.
B) Convex scheduled functions to periodically check for new notifications and batch-send them to the client.
C) Convex Workflow component to orchestrate long-running processes, ensuring that the debounce logic executes reliably over time. I'm considering defining a workflow that delays email sending to batch multiple messages.
D) Some other approach?
30 replies
CCConvex Community
•Created by CodingWithJamal on 11/15/2024 in #support-community
Notification System Design Advice
6 replies
CCConvex Community
•Created by CodingWithJamal on 9/26/2024 in #support-community
Need a little react help
Hello family, its been a while. So for my site I wanted to save a simple count of users visited. I wrote this code:
which works fine but for some reason every page refresh the
updateGlobalStats
is called even when the view has been set in local storage? This should not happen
This is the console output.12 replies
CCConvex Community
•Created by CodingWithJamal on 7/24/2024 in #support-community
Realtime game with convex...?
So for the last few days ive been using socket.io (in rust) to build a simple 2d realtime game in react. I didnt want to use raw ws api but I also wanted control over how my data is sent. But then it made me think, could I use convex as a point of truth for my game since all clients can connect to the same query and mutate data?
In my rust backend server I have the server create a room id, and spawn threads for players for each room. However in convex I could just have tables and when a game is created just add the userId to an active_game table or something. But another problem I thought about is player movements. The only way to make things seem realtime is to have updates to all player actions brodcasted to other players as well. This feels very expensive as players can trigger thoughsands of mutations per minute when playing the game... Maybe I could get away with coding a complex backend myself If I self host convex?
Anyways, I really just want the community's opinion on this idea. Convex is great as a database and its selling point is realtime connections. If I was building a chess clone, this would be easier but I want a realtime game were players can move and control there 2d character and other players connected to the same game can see there movements. Which might be were my limitation is reached with convex... Either way, If I dont use convex as my core backend and write my own..I will still use convex for authenication and other site features later on for the game.
19 replies
CCConvex Community
•Created by CodingWithJamal on 7/16/2024 in #support-community
Convex Auth Discord Setup
10 replies
CCConvex Community
•Created by CodingWithJamal on 6/18/2024 in #support-community
Convex ents
Hey, ive been playing with using
convex ents
today and like it. I didnt see an answer in the docs so im here...
I like the idea of https://labs.convex.dev/convex-ents/schema#unique-fields , they can be helpful for things like an email field. however, when a uniue field is found, how does the convex function tell me this? I dont see any error type info on ents. I need a way to tell my froend end about this,6 replies
CCConvex Community
•Created by CodingWithJamal on 3/29/2024 in #support-community
Help moving data to prod
So for my convex app, i have some data in dev that ive been using to built out my site. I want to reuse this data in prod again without having to run more web crawlers just to get the data... Is there a good way todo this already?
5 replies
CCConvex Community
•Created by CodingWithJamal on 3/25/2024 in #support-community
Convex Rust Client (None Async) help
Hello, im writing a a web scrapper and i want to save some data to convex. I cant use async rust. So how can i use the convex base client to send some mutation data over to my convex server.
Here is the code. However i have a few errors:
Why does the mutation take this type? Should it not be the key of the function?
7 replies
CCConvex Community
•Created by CodingWithJamal on 3/23/2024 in #support-community
RSS in convex help
Good afteroon, so for my site I want to implement https://www.npmjs.com/package/rss-parser and add some data to my nextjs app.
im trying to think of a way to save the feed data into convex, but how would i use the library on the backend? The only way i know to run convex code like db.insert is in functions but we can use npm. im trying to avoid having to write another rest server just to save rss information. Would i use maybe nextjs api rountes?
17 replies
CCConvex Community
•Created by CodingWithJamal on 2/9/2024 in #support-community
React Native / Clerk Auth / Expo Help
Continuing from https://discord.com/channels/1019350475847499849/1019350478817079338/1205262625525465120
12 replies
CCConvex Community
•Created by CodingWithJamal on 12/5/2023 in #support-community
Convex dev hanging
8 replies
CCConvex Community
•Created by CodingWithJamal on 11/16/2023 in #support-community
NextJs Server Actions + Convex not working
Im trying to use convex http client in nextjs server actions to submit data. However its not working. When i console log the form data, i get all my valid data. However the mutation does not submit to convex? It does not run at all and theres no errors i can see.
17 replies
CCConvex Community
•Created by CodingWithJamal on 11/2/2023 in #support-community
Database Architecture Concerns
Hello convex team. Currently im working on a new SAAS application and its main feature allows users to post data to my public api and store data for them to view later. In theory i want users to be able to store thousands of rows in my database for them to query later, however I was thinking would this not be bad for convex later on? Because each users data does not need to be synced with each other (always). Idealy, I would want a master database where the auth user data is stored, and other things. But users specific data is stored in there own database (table in this case) where each user (s) can only see there data.
Im not sure if convex can do something like this, im concerned that in the future If i have a lot of data, it will slow down other users accessing data because the data stored will still need to be parsed from top to bottom in the querys. Just looking for some advice, I love convex as a datavase but im not sure If its the best at my needs for this project. Vs something like sqlite where If i wanted more databases, I could just make another file and have user data separated from each other completely and not have other user data effecting performance (reads / writes ) of others
3 replies
CCConvex Community
•Created by CodingWithJamal on 10/30/2023 in #support-community
Convex Argument Validtion Error?
I keep getting this error. Im not sure why?
4 replies
CCConvex Community
•Created by CodingWithJamal on 10/27/2023 in #support-community
React Server Components + Convex Auth State Support?
So im in my nextjs app the convex docs says to use the
useConvexAuth
hook.
hook makes sure that the browser has fetched the auth token needed to make authenticated requests to your Convex backendHowever, you cant use Hooks in RSC, so is it not possible for convex to know the auth state on the server side? Im asking because i want to fetch data on the server side and pass it to my client components as props. Avoiding having to do a lot of api calls from the client side. I know I can use the Js http client but im not sure how to handle auth session from there. And I want most of my business logic to stay on the server.
9 replies
CCConvex Community
•Created by CodingWithJamal on 9/5/2023 in #support-community
Stripe and Convex HTTP Help
15 replies