[BUG] Realtime confirms a block or variable edit before it is stored, so a failed write loses it

Aperta
#10,712 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

  1. Open the same workflow in two tabs or as two users on the same realtime pod.
  2. Edit the same field in both, with B's edit arriving while A's write is in progress (a slow database widens the window).
  3. Make B's write fail, for example by locking the block.
  4. 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.

Lingua principale
TypeScript
Stelle
29.8k
Fork
3.9k
Merge medio
1h 43m
PR unite (30g)
937

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di simstudioai/sim

Tutte le issue di simstudioai/sim

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.