From 532189b618baf4071b5475b6d298a60aff3a18f8 Mon Sep 17 00:00:00 2001 From: tiye Date: Wed, 2 Sep 2026 16:48:27 +0800 Subject: [PATCH] fix: keep updater store boundary nominal --- calcit.cirru | 3 +-- history/202609021755-static-store-boundary.md | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 history/202609021755-static-store-boundary.md diff --git a/calcit.cirru b/calcit.cirru index 358740f..dc5ee45 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -2308,8 +2308,7 @@ :code $ quote defn updater (raw-store op op-id op-time) let - store $ if (struct? raw-store) (unsafe-coerce raw-store 'app.schema/Store) - decode-map-as (dissoc raw-store :current-chapter-id) 'app.schema/Store + store raw-store match op (:states cursor s) assoc store :states $ assoc-in (:states store) diff --git a/history/202609021755-static-store-boundary.md b/history/202609021755-static-store-boundary.md new file mode 100644 index 0000000..18f5ecb --- /dev/null +++ b/history/202609021755-static-store-boundary.md @@ -0,0 +1,13 @@ +# Keep the updater Store boundary static / 保持 updater 的 Store 静态边界 + +## English + +- Stop re-decoding `raw-store` inside `app.updater/updater`; its declared input is already the nominal `Store` used by Reel. +- Keep `decode-map-as` at the actual external storage hydration boundary, where legacy persisted maps still enter the typed application. +- Prevent the newer compiler from rejecting a Struct value passed back through a Map decoder while preserving legacy-session migration behavior. + +## 中文 + +- `app.updater/updater` 不再二次 decode `raw-store`;其声明输入已经是 Reel 使用的 nominal `Store`。 +- `decode-map-as` 继续保留在真实的外部存储 hydration 边界,用于旧持久化 Map 进入类型化应用时的迁移。 +- 避免新版编译器拒绝把 Struct 再次送入 Map decoder,同时保持 legacy session 的迁移行为。