Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(update): drop leftover relogin flag after offline channel discard

guyongf3b631875ec6
diff --git a/apps/desktop/src/main/__tests__/updateService.test.ts b/apps/desktop/src/main/__tests__/updateService.test.ts
index 2d0fd2ff5c..52a6baaf44 100644
--- a/apps/desktop/src/main/__tests__/updateService.test.ts
+++ b/apps/desktop/src/main/__tests__/updateService.test.ts
@@ -1155,6 +1155,8 @@ describe('startup update relaunch safety', () => {
enableBeta: false,
}),
);
+ const flagPath = path.join(TEST_USER_DATA, 'relogin-required.flag');
+ fs.writeFileSync(flagPath, JSON.stringify({ version: '0.0.65' }));
readUpdateChannelSettings.mockReturnValue({
enableBeta: true,
orgDefaultEnableBeta: true,
@@ -1173,6 +1175,7 @@ describe('startup update relaunch safety', () => {
expect(service.getUpdateStatus()).toBe('idle');
expect(fs.existsSync(path.join(updatesDir, 'patch-info.json'))).toBe(false);
expect(fs.existsSync(path.join(updatesDir, 'xdt-maker-0.0.65.zip'))).toBe(false);
+ expect(fs.existsSync(flagPath)).toBe(false);
} finally {
service.stopUpdateService();
}
diff --git a/apps/desktop/src/main/updateService.ts b/apps/desktop/src/main/updateService.ts
index fc4ebeed42..55ce274fec 100644
--- a/apps/desktop/src/main/updateService.ts
+++ b/apps/desktop/src/main/updateService.ts
@@ -593,6 +593,10 @@ function checkExistingPatch(): { action: 'relaunch' | 'check' | 'none'; version?
);
try { fs.unlinkSync(patchFilePath); } catch { /* ignore */ }
removePatchInfo();
+ const flag = readReloginFlag();
+ if (flag?.version === patchInfo.version) {
+ clearReloginFlag();
+ }
return { action: 'check' };
}