fix(web): support PostgREST not(col, is) so archived session lists load
Independent Staging Quality Gate / validate (push) Successful in 10m31s
Independent Staging Quality Gate / publish (push) Successful in 3m37s

Local Postgres not() only handled eq/cs, so archived=1 threw and the sidebar archive view returned 500. Compile is not null/true/false instead of inequality.
This commit is contained in:
jesse-ux
2026-09-21 17:45:07 +08:00
parent 70d595e361
commit df329fa96c
8 changed files with 137 additions and 9 deletions
+16
View File
@@ -13103,3 +13103,19 @@
- 相关记录:BUG-928、BUG-987
- 复发自:BUG-928(延迟落库让步未收口)
- 修复版本:待本修复合入 staging
## BUG-990 | 侧栏切到归档记录后 500
- 状态:investigating
- 首次发现:2026-09-21
- 最近更新:2026-09-21
- 影响面:`LocalPostgresQueryBuilder.not()``GET /api/sessions?archived=1`、侧栏「归档记录」
- 用户现象:点侧栏「归档记录」后聊天记录读不出来(500「聊天记录暂时无法读取」)。
- 触发条件:自托管本地 Postgres 上打开归档视图。托管 Supabase 不受影响。
- 根因:兼容层 `not()` 只实现 PostgREST 算子子集 `eq` / `cs``applyArchiveFilter(..., true)` 调用 `not("archived_at", "is", null)`,构造期不报错,真跑 SQL 时 throw `unsupported not filter`,被列表路由外层 catch 成 500。该调用自 `a1956deb`(BUG-553)就在,此前没有真实数据库测试走到归档分支。
- 修复:`not()` 增加 `is` 分支,新 filter kind `isNot`,编译为 `is not null` / `is not true` / `is not false`。不得写成 `<> null`(恒为 NULL,会静默 0 行)。
- 验证:`local-postgres-not.test.ts``database-session-list-visibility.test.ts` 归档分支(有 Docker 时)。**本记录在 `test:db` 或门禁该测试转绿前不得标 resolved。**
- 防复发:兼容层新增算子必须有真实 Postgres 覆盖,不得只加源码正则。
- 相关记录:BUG-553、BUG-926、BUG-987
- 复发自:BUG-926(同一兼容层的不同缺口:当时是 `order()` 只留最后一键)
- 修复版本:待本修复合入 staging 且门禁该测试转绿