Web Dev CodyW
Convex Community2y ago
7 replies
Web Dev Cody

Need help understanding the mutations and OCC

I'm working on a million checkboxes type of clone, and I have a function called toggleCheckbox which will first query a record, toggle a bit on or off in the number, and then write that number. This all seems to work fine. I'm also using another metadata table to keep a running sum of how many checkboxes are on or off. It seems like the counts are getting off for some reason.

I created a cron which randomly toggles a bit using that same method described above every second in the first set of checkboxes. That also seems to work fine. The issue is when I manually start clicking checkboxes while the cron is running that my count seems to get off. I think there is something I'm not understanding about the concurrency model.
Was this page helpful?