- [Web/Headless Update Settings 400 Fix & Partial Patch Merge Governance] (Fixes #3754):
- Dual-Shape Request Body Compatibility for Axum Admin API:
POST /api/system/updates/savenow accepts both the{"settings": {...}}wrapper forwarded by the frontendinvokemapping and the flat JSON used by Headless/CLI clients, permanently fixing the deterministic 400 Bad Request (content-length: 0) when switching to the Beta channel or toggling auto-check in Web mode. (Fixes #3754) - Update Settings Now Apply as Partial Patches: Introduced
UpdateSettingsPatchandpatch_update_settingsso only explicitly provided fields are overwritten; omitted fields (last_check_time,update_channel) retain their persisted values. This root-cause fixes the silent channel reset to the build default when toggling auto-check, and the last-check timestamp being zeroed on every save. (Fixes #3754) - Error Propagation & Empty-Patch Guard: Persistence failures now surface as 500 with an error body, and empty patches return 400 with the list of expected fields, eliminating the previous
let _ =silent-success path. (Fixes #3754) - Unified Semantics Across Web and Desktop: The Tauri command now uses the same patch semantics; the frontend drops the hardcoded
last_check_time: 0and submits onlyupdate_channelwhen switching channels. (Fixes #3754) - Regression Test Coverage: Added unit tests for wrapped/flat payload parsing, unknown-field empty-patch detection, patch field preservation, and empty-patch rejection. (Fixes #3754)
- Dual-Shape Request Body Compatibility for Axum Admin API:
- [Web/Headless 更新设置保存 400 修复与局部补丁合并治理] (Fixes #3754):
- Axum 管理接口请求体双形态兼容:
POST /api/system/updates/save现同时接受前端invoke映射透传的{"settings": {...}}包装体与 Headless/CLI 的平铺 JSON,彻底修复 Web 端切换预览版通道或修改自动检查更新时必然返回 400 Bad Request(content-length: 0)的问题。(Fixes #3754) - 更新设置改为局部补丁合并: 新增
UpdateSettingsPatch与patch_update_settings,仅覆盖显式提供的字段;未传字段(last_check_time、update_channel)保留磁盘现值,根治切换自动检查开关会把更新通道静默重置为构建默认值、以及每次保存都清空最近检查时间并触发立即检查的连带缺陷。(Fixes #3754) - 错误透传与空补丁防呆: 持久化失败如实返回 500 与错误体,空补丁返回 400 并附带期望字段列表,不再出现
let _ =吞错导致的“写入失败仍返回 200”假成功。(Fixes #3754) - Web 与桌面双链路语义统一: Tauri 命令同步切换为补丁语义,前端移除
last_check_time: 0硬编码并在切换通道时仅提交update_channel,两条链路行为完全一致。(Fixes #3754) - 回归测试覆盖: 新增包装体/平铺体解析、未知字段空补丁识别、补丁字段保留与空补丁拒绝等单元测试,防止后续回归。(Fixes #3754)
- Axum 管理接口请求体双形态兼容:
Full Changelog: v5.0.1-beta.0...v5.0.1-beta.1