mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 16:02:50 +00:00
fix updater marker ordering and shutdown guard test
This commit is contained in:
@@ -100,16 +100,16 @@ export abstract class UpdaterInstallExecution extends UpdaterPackageRecovery {
|
||||
recordUpdaterLifecycle('quit_and_install_invoking_native', {
|
||||
version: pendingVersion || null
|
||||
})
|
||||
// Why: defensive — never call quitAndInstall if recovery/reset already cleared the handoff.
|
||||
if (!this.quitAndInstallInProgress) {
|
||||
return
|
||||
}
|
||||
// Why before the native call: from here ShipIt waits for this process to exit, and any
|
||||
// launch of this bundle in that window cancels the install. The marker is the only way
|
||||
// a launching process can know that, because this process is about to be gone.
|
||||
if (process.platform === 'darwin') {
|
||||
markMacUpdateInstallInFlight(pendingVersion)
|
||||
}
|
||||
// Why: defensive — never call quitAndInstall if recovery/reset already cleared the handoff.
|
||||
if (!this.quitAndInstallInProgress) {
|
||||
return
|
||||
}
|
||||
// Why: mark before the call so a sync 'error' during quitAndInstall can recover; pre-native errors must not look like install failure.
|
||||
this.quitAndInstallNativeInvoked = true
|
||||
// Why: invoke before killAllPty/removing close listeners so a sync 'error' can recover while windows and PTYs are intact.
|
||||
|
||||
@@ -193,7 +193,7 @@ describe('createShutdownCheckpointGuard', () => {
|
||||
join(process.cwd(), 'src/renderer/src/components/use-terminal-editor-close-foundation.ts'),
|
||||
'utf8'
|
||||
)
|
||||
const closeStart = source.indexOf('const confirmNativeWindowClose = useCallback(() => {')
|
||||
const closeStart = source.indexOf('const confirmNativeWindowClose = useCallback(')
|
||||
const closeEnd = source.indexOf('window.api.ui.confirmWindowClose()', closeStart)
|
||||
expect(closeStart).toBeGreaterThanOrEqual(0)
|
||||
expect(closeEnd).toBeGreaterThan(closeStart)
|
||||
|
||||
Reference in New Issue
Block a user