boot: reconcile fast-forward does not re-open the store snapshot, so in-memory state is built from the pre-reconcile tree
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
- git, typescript
Direzione di ricerca
Inizia con la registrazione store → reconcile → services di buildApp e confrontala con reloadInMemoryStateAndFts. Leggi apps/api/tests/internal-reload.test.ts, in particolare il test di reimportazione e il relativo workaround di fetch pre-boot. Il lavoro è completato quando un clone riutilizzato produce uno stato in memoria e FTS contenenti record introdotti da reconcile prima dell’inizializzazione dei services.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What
buildApp registers the plugins in this order: store (opens the gitsheets public store; each Sheet caches a dataTree snapshot at open time) → reconcile (fetch + fast-forward/rebase against origin/<CFP_DATA_BRANCH>) → services (builds InMemoryState + FTS from fastify.store.public).
When the local bare clone is behind origin at boot, reconcile fast-forwards the branch, but nothing calls Store.swapPublic afterwards. services then builds the in-memory state from the Sheet snapshots captured before the fast-forward. Records that arrived in the fast-forward are invisible until the next hot-reload webhook or a restart.
The hot-reload path (reloadInMemoryStateAndFts) already handles this correctly by re-opening the public store after reconcile. The boot path skips that step.
Why it hasn't bitten
Production pods bare-clone the data repo on every boot (emptyDir volume), so the clone is in sync with origin by the time reconcile runs and the outcome is in-sync. The gap only shows when a clone is reused across boots: local dev, and tests that seed the remote after creating the rig (see the re-import test in apps/api/tests/internal-reload.test.ts, which works around it with an explicit git fetch origin main:main before boot).
Fix sketch
In the reconcile plugin (or a small step between it and services), when the outcome is anything other than in-sync/fetch-failed, re-open the public store and fastify.store.swapPublic(freshPublic) before services reads it. Or reorder so the store opens after reconcile; reconcile only needs the repo path and the lock, not the Sheet handles.
Found while working on the hot-reload stale-indices fix (fix/hot-reload-stale-indices); out of scope there.
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 1
- Merge medio
- 11m
- PR unite (30g)
- 22
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
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 CodeForPhilly/codeforphilly-ng
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
CodeForPhilly/codeforphilly-ng#178 ·
I maintainer di solito rispondono entro 1 giorno
-
MarkdownEditor toolbar: use Radix Toolbar from radix-ui instead of the hand-rolled roving tabindexApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
CodeForPhilly/codeforphilly-ng#169 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
CodeForPhilly/codeforphilly-ng#89 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
CodeForPhilly/codeforphilly-ng#87 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
CodeForPhilly/codeforphilly-ng#50 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di CodeForPhilly/codeforphilly-ng
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno