fix: allow deleting system default sync channel with immediate heal

Remove hard ban that returned 400 with no UI feedback; delete then Ensure+rebinding, and show confirm/toast on SyncPage.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
whm
2026-08-06 09:03:41 +08:00
parent 362dcee242
commit 75622a728e
4 changed files with 56 additions and 16 deletions

View File

@@ -869,6 +869,8 @@ export type SyncChannel = {
pk_columns: Record<string, string>;
/** 绑定智能体:模块/库归属对照 */
agent_id?: number;
/** 公司默认同步通道Z12 */
is_system_default?: boolean;
/** 绑定已发布模块 slug */
app_slug?: string;
last_error?: string;
@@ -966,6 +968,16 @@ export async function deleteSyncChannel(session: Session, id: string) {
});
const data = await readJson(res);
throwIfBad(res, data, "delete sync channel failed");
return data as {
ok?: boolean;
deleted_id?: string;
was_system_default?: boolean;
recreated_default?: boolean;
channel_id?: string;
bindings_fixed?: number;
agents_fixed?: number;
heal_error?: string;
};
}
export async function testSyncEndpoints(