What simple prompt rules do you use to stop AI tools from ignoring concurrent user edits?
by•
Built a quick invoice app using cursor over the weekend and everything worked great on my end.
Then two people tried editing at the same time and one ended up overwriting the other's changes without any warning. Turns out AI coders won't add multi-user checks unless you explicitly ask for them.
Do you guys have a short prompt checklist to catch shared state issues before testing with real users?
29 views
Replies
One question I ask for every write: what happens if two requests do this at the same time? The "check first" pattern breaks here. My API checks if an agent name exists before creating it, but two requests can both pass that check. So the database constraint is the real rule, and when the insert fails I roll back and return 409 instead of a 500. For records people edit, store a version or updated_at and reject the save if it changed since they loaded it.