boot: reconcile fast-forward does not re-open the store snapshot, so in-memory state is built from the pre-reconcile tree
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- git, typescript
调研方向
从 buildApp 的 store → reconcile → services 注册开始,并将其与 reloadInMemoryStateAndFts 进行比较。阅读 apps/api/tests/internal-reload.test.ts,尤其是重新导入测试及其启动前的 fetch workaround。当复用的 clone 生成的内存状态和 FTS 中包含 reconcile 在 services 初始化前引入的记录时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 1
- 派生
- 1
- 平均合并
- 11 分钟
- 30 天内合并 PR
- 22
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CodeForPhilly/codeforphilly-ng 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
CodeForPhilly/codeforphilly-ng#178 ·
维护者通常 1 天内回复
-
MarkdownEditor toolbar: use Radix Toolbar from radix-ui instead of the hand-rolled roving tabindex未关闭enhancement
难度 2/5 1-3 小时 新手友好度 82/100
CodeForPhilly/codeforphilly-ng#169 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
CodeForPhilly/codeforphilly-ng#89 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
CodeForPhilly/codeforphilly-ng#87 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
CodeForPhilly/codeforphilly-ng#50 ·
维护者通常 1 天内回复
查看 CodeForPhilly/codeforphilly-ng 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug p3 triaged
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
bug javascript P2-medium python release:v3.1
难度 2/5 1-3 小时 新手友好度 68/100
adrirubio/claude-deck#546 ·
维护者通常 1 天内回复
-
area: desktop area: website priority: P2 type: feature
难度 2/5 1-3 小时 新手友好度 62/100
appandflow/stim#3411 · 1 条评论 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 65/100
rjsf-team/react-jsonschema-form#5485 ·
维护者通常 2 天内回复