Files
Nexus/docs/changelog/2026-06-11-servers-search-null-fix.md
2026-07-08 22:31:31 +08:00

989 B
Raw Permalink 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。