mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 08:06:19 +00:00
fix(settings): preserve drafts after rejected saves (#551)
Keep unsaved settings and their revision when the management API rejects a request with a structured 4xx response. Continue reconciling settings for uncertain write outcomes, including transport failures and server errors. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -414,8 +414,11 @@ export function useSettingsForm() {
|
||||
})
|
||||
}, {
|
||||
onError: (cause) => {
|
||||
if (cause instanceof ApiError && cause.status !== 409)
|
||||
// 明确拒绝的请求保留草稿,执行结果未知时仍回读设置以同步已提交的版本
|
||||
if (cause instanceof ApiError && cause.status !== 409
|
||||
&& (cause.kind !== 'api' || cause.status < 400 || cause.status >= 500)) {
|
||||
void loadSettings(true)
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user