Serialize empty store lists as JSON arrays and advance the core pin #2

Merged
weichen merged 1 commits from fix/empty-list-json into main 2026-09-30 03:24:02 +00:00
Owner

基线与授权

R0=backend main(迁移后);授权:空列表序列化修复(任务卡 .task/fix-empty-list-json.md)

问题与证据

新建项目白屏根因:store List* 用 nil 切片,JSON 编码为 null,前端 conversations.map 崩溃。实测 GET /api/projects/{id}/conversations 返回 null。

变更

17 处 var out []T → out := []T{};core gitlink 从不可物化的 019617e 前进到当前 main(迁移遗留构建阻塞);回归测试 TestEmptyListsSerializeAsEmptyArrays。

验证

go test ./... 全包 PASS(11 ok / 0 FAIL)。

## 基线与授权 R0=backend main(迁移后);授权:空列表序列化修复(任务卡 .task/fix-empty-list-json.md) ## 问题与证据 新建项目白屏根因:store List* 用 nil 切片,JSON 编码为 null,前端 conversations.map 崩溃。实测 GET /api/projects/{id}/conversations 返回 null。 ## 变更 17 处 var out []T → out := []T{};core gitlink 从不可物化的 019617e 前进到当前 main(迁移遗留构建阻塞);回归测试 TestEmptyListsSerializeAsEmptyArrays。 ## 验证 go test ./... 全包 PASS(11 ok / 0 FAIL)。
weichen added 1 commit 2026-09-30 03:24:02 +00:00
Why: backend main pinned core 019617e (unfetchable post-migration) and the
store List* functions returned nil slices that encode as JSON null, which
crashed the frontend nav with .map on null (the 2026-09-30 white-screen).
Evidence: go test ./... across all packages; store regression
TestEmptyListsSerializeAsEmptyArrays asserts [] for empty project lists.
Impact: all 17 store list sites now initialize empty slices; build-blocker
core pin resolved; frontend no longer receives null for empty lists.
Refs: documents/records/2026-09-30-history-migration.md
weichen merged commit 6e515dacc1 into main 2026-09-30 03:24:02 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#2