[BUG] Realtime confirms a block or variable edit before it is stored, so a failed write loses it
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend, distributed-systems
Research direction
Start with apps/realtime/src/handlers/subblocks.ts and variables.ts, tracing how a flush handles pending edits, confirmations, failures, and actor IDs. Reproduce the overlap with two tabs and a failed write, then check that each edit settles only after its own write and collaborators see the stored value with the correct audit actor.
Written by the indexing model from the issue text.
Description
Describe the bug
When an edit to a subblock or variable field arrives while the previous edit of that field is being written, it joins that write's operation list. The earlier write confirms it before its value is stored. If its own write then fails, the client has already dropped the operation and ignores the failure, so the edit is lost while the UI still shows it. In the same overlap the first editor can be left showing a stale value, a later edit can be dropped without an answer, and the variable audit log can name the wrong user.
To Reproduce
- Open the same workflow in two tabs or as two users on the same realtime pod.
- Edit the same field in both, with B's edit arriving while A's write is in progress (a slow database widens the window).
- Make B's write fail, for example by locking the block.
- B sees the edit as saved, but it is not stored.
Expected behavior
Each edit is confirmed or failed only after its own write settles, every collaborator ends with the stored value, no edit is silently dropped, and the audit actor is the user who made the change.
Additional context
apps/realtime/src/handlers/subblocks.ts and variables.ts: a flush reads pending.latest when it starts but reads opToSocket and actorId at the end, and deletes the map entry after a newer edit may be using it.
- Dominant language
- TypeScript
- Stars
- 29.8k
- Forks
- 3.9k
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 937
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simstudioai/sim
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simstudioai/sim#10710 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
simstudioai/sim#10708 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
simstudioai/sim#10706 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
simstudioai/sim#10704 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simstudioai/sim#10702 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
melgarafael/DeskcommCRM#5614 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 76/100
slackapi/slack-health-score#253 ·
Maintainers usually reply within 1 day
-
feature needs triage site
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
owid/owid-grapher#8019 ·
Maintainers usually reply within 1 day
-
via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
callstackincubator/simlock#2088 ·
Maintainers usually reply within 1 day