Files
Nexus/docs/changelog/2026-06-11-servers-search-null-fix.md
T
Nexus Agent af912662de fix: combobox 清空 null 导致服务器列表加载失败
v-combobox 清空时 search 为 null 使 trim() 抛错;422 响应剥离不可序列化的 ctx 避免 500。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 17:52:49 +08:00

989 B
Raw Blame History

Changelog — 修复 Servers 搜索 combobox null 导致列表加载失败

日期2026-06-11

摘要

v-combobox 清空时 searchnulltrim() 抛错触发「加载服务器列表失败」;同时 { query: null } 使 422 响应因 ctxValueError 无法 JSON 序列化而变成 500。

动机

生产日志:PUT /api/servers/search-history 输入 query: null → 422 处理崩溃;前端 search.value.trim() 在 null 时异常。

涉及文件

  • frontend/src/composables/useServerPagination.ts
  • frontend/src/composables/useServerSearchHistory.ts
  • frontend/src/pages/ServersPage.vue
  • server/utils/validation_errors_zh.py
  • tests/test_validation_errors_zh.py

迁移 / 重启

  • 需部署前后端;无 DB 变更

验证

pytest tests/test_validation_errors_zh.py tests/test_server_search_history.py -q
cd frontend && npm run type-check

Servers 页清空搜索框 → 列表正常加载,无错误 toast。