Harden draft saves against a partial failure
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
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
Inizia in src/services/projectStorage.ts, intorno alla logica di readAnalysisShard alle righe 234-241, poi segui saveDraft e l’ordine di shard, envelope ed eliminazione. Conferma il comportamento di scrittura dell’envelope per un insieme di libri in crescita e riesamina la motivazione dell’eliminazione. Il lavoro è completato quando un salvataggio interrotto lascia contenuto obsoleto invece di un libro senza nome, mentre gli shard mancanti vengono conservati invece di essere eliminati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
saveDraft writes every changed shard, then the envelope naming them. A save torn between those two steps leaves a book that this save analyzed for the first time named by no manifest — the old envelope predates it, the new one never landed — so its work is unreachable on reopen.
Writing the envelope with old ∪ new books before the shards would close that: every book stays named throughout, so a torn save yields stale content rather than absent content.
This is safe because a manifest naming a not-yet-written shard is already handled — readAnalysisShard returns readable: false for ENOENT, so the book is held rather than wiped:
Cost is one extra envelope write, and only when the book set grows.
Field-vs-shard skew is inherent regardless — papi.storage.writeUserData is a plain fs.promises.writeFile, so no single write here is atomic. This only closes the silent-absence case.
Note the delete step's ordering rationale ("deleting only once the envelope has stopped naming the book keeps a failure here from stranding the manifest on a missing shard") would need reworking alongside this, since the envelope would no longer be written exactly once per save.
Raised by @imnasnainaec (drafted by Devin) reviewing #316, and deferred from it as out of scope.
Merged from #322: Revisit the draft save no-retry decision now that a failed save is a partial commit
Before per-book partitioning, the draft was one record: a rejected write was a no-op, leaving the previous draft intact.
Now the analysis spans several records, written before the envelope. A save that fails partway persists a partial state — some books from the new save, the rest from the old one — which stands until the next keystroke triggers another auto-save, and permanently if the user stops editing at that moment.
The next save does repair it: what reached storage is tallied as it lands, so the following save rewrites only the books still missing it. The gap is only that nothing forces a next save to happen.
That makes the documented no-retry decision more expensive than when it was made, which is worth revisiting on its own rather than inside the PR that changed the cost. Options include retrying a failed draft save, or surfacing the failure so the user knows the draft on disk is mixed.
Raised by @imnasnainaec (drafted by Devin) reviewing #316, and deferred from it as out of scope.
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 0
- Merge medio
- 2g 5h
- PR unite (30g)
- 42
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sillsdev/interlinearizer-extension
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
sillsdev/interlinearizer-extension#388 ·
I maintainer di solito rispondono entro 1 giorno
-
Set default interlinear view optionsForse già presa @alex-rawlings-yyc l’ha presa 2 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
sillsdev/interlinearizer-extension#386 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
sillsdev/interlinearizer-extension#383 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
sillsdev/interlinearizer-extension#382 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
sillsdev/interlinearizer-extension#379 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sillsdev/interlinearizer-extension
Issue simili
-
ble-needs-fable-review bug mobile priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ColeMurray/background-agents#2305 ·
I maintainer di solito rispondono entro 1 giorno
-
bug from-studio
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
esengine/DeepSeek-Reasonix#12355 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
oblien/openship#1086 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno