Skip to content

The agent that grows with you

fmt(desktop): npm run fix over the review-fix files

ethernet20eebc4afad5
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 52f5ccb956a..4ec40c4f6b5 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -82,8 +82,8 @@ import { createBackendServeSupportResolver } from './backend-serve-support'
import {
isHostKeyChangedBootFailure,
isRetryableRemoteBootFailure,
- shouldLatchBackendStartFailure,
shouldHoldBootProgressForReauth,
+ shouldLatchBackendStartFailure,
shouldLatchHostKeyChangedFailure,
shouldLatchRemoteReauthFailure
} from './backend-start-failure'
@@ -318,6 +318,7 @@ import { registerMcpOauthCallbackIpc } from './mcp-oauth-callback-ipc'
import { createMediaProtocolHandler, MEDIA_PROTOCOL } from './media-protocol'
import { fetchLocalMedia } from './media-range'
import { createMinimizeToTray } from './minimize-to-tray'
+import { createNativeAccessTokenCoordinator, NativeAuthChangedError } from './native-access-token'
import type { GatedDownloadAuth } from './native-auth-decisions'
import {
oauthSessionIsLive,
@@ -326,7 +327,6 @@ import {
resolveOauthRestAuth,
resolveReadinessProbeAuth
} from './native-auth-decisions'
-import { createNativeAccessTokenCoordinator, NativeAuthChangedError } from './native-access-token'
import {
nativeRefreshUrl,
type NativeTokenSet,
@@ -373,6 +373,7 @@ import { createPoolStopper } from './pool-stop'
import { poolTouchKeys } from './pool-touch-scope'
import { createPortalSession } from './portal-session'
import { createKeepAwake } from './power-save'
+import { readPreUpdateBackupEnabled } from './pre-update-backup-config'
import { capturePreviewContents } from './preview-capture'
import { PreviewReachRegistry } from './preview-reach'
import {
@@ -429,7 +430,6 @@ import {
resolveRemoteRequestHeaders
} from './remote-ws-headers'
import { missingRendererAssets } from './renderer-bundle'
-import { readPreUpdateBackupEnabled } from './pre-update-backup-config'
import { planLaunchSwitches, readDesktopLaunchConfig } from './renderer-heap-flags'
import { loadRendererLoadErrorPage } from './renderer-load-error-page'
import { attachRendererConsoleCapture, formatRendererBoundaryReport } from './renderer-log'
diff --git a/apps/desktop/electron/update-prerequisites.test.ts b/apps/desktop/electron/update-prerequisites.test.ts
index c206f7b7760..060cfdc499f 100644
--- a/apps/desktop/electron/update-prerequisites.test.ts
+++ b/apps/desktop/electron/update-prerequisites.test.ts
@@ -67,15 +67,18 @@ test('earlier PM user-bin launchers are accepted only for the reported source tr
// The .cmd rung goes through cmd.exe with a fixed argv; a launcher path that
// cmd.exe would re-parse (quote, %var%, &, |, redirection) is refused instead of
// being handed to the shell. Windows-only: POSIX launchers never touch a shell.
-test.skipIf(process.platform !== 'win32')('a .cmd launcher path with cmd metacharacters is refused, not executed', (): void => {
- const root: string = fs.mkdtempSync(path.join(os.tmpdir(), 'cmd-meta-launcher-'))
+test.skipIf(process.platform !== 'win32')(
+ 'a .cmd launcher path with cmd metacharacters is refused, not executed',
+ (): void => {
+ const root: string = fs.mkdtempSync(path.join(os.tmpdir(), 'cmd-meta-launcher-'))
- try {
- const launcher: string = path.join(root, 'a&b', 'hermes.cmd')
- fs.mkdirSync(path.dirname(launcher))
- fs.writeFileSync(launcher, `@echo off\r\necho Install directory: ${root}\r\n`)
- assert.equal(launcherTargetsInstallation(launcher, root), false)
- } finally {
- fs.rmSync(root, { recursive: true, force: true })
+ try {
+ const launcher: string = path.join(root, 'a&b', 'hermes.cmd')
+ fs.mkdirSync(path.dirname(launcher))
+ fs.writeFileSync(launcher, `@echo off\r\necho Install directory: ${root}\r\n`)
+ assert.equal(launcherTargetsInstallation(launcher, root), false)
+ } finally {
+ fs.rmSync(root, { recursive: true, force: true })
+ }
}
-})
+)
diff --git a/apps/desktop/electron/updater/checkout-handoff.test.ts b/apps/desktop/electron/updater/checkout-handoff.test.ts
index 41ac8204063..ab51a8ba895 100644
--- a/apps/desktop/electron/updater/checkout-handoff.test.ts
+++ b/apps/desktop/electron/updater/checkout-handoff.test.ts
@@ -97,6 +97,7 @@ it('a failed hand-off spawn keeps the app alive and reports the failure in plain
const child: EventEmitter & updaterProcess.UpdaterChild = Object.assign(new EventEmitter(), {
unref: (): void => {}
})
+
queueMicrotask((): void => {
child.emit('error', Object.assign(new Error('spawn ENOENT'), { code: 'ENOENT' }))
})
@@ -107,6 +108,7 @@ it('a failed hand-off spawn keeps the app alive and reports the failure in plain
try {
const result: Awaited<ReturnType<ReturnType<typeof createCheckoutStrategy>['apply']>> =
await createCheckoutStrategy(deps).apply()
+
expect(result).toMatchObject({ ok: false, error: 'updater-spawn-failed' })
expect(result.message).toMatch(/Hermes keeps running/)
expect(result.message).toMatch(/Details: .*ENOENT/)
diff --git a/apps/desktop/electron/updater/feed-config.test.ts b/apps/desktop/electron/updater/feed-config.test.ts
index 689958e7318..5a64cb0a97d 100644
--- a/apps/desktop/electron/updater/feed-config.test.ts
+++ b/apps/desktop/electron/updater/feed-config.test.ts
@@ -57,7 +57,6 @@ it('leaves fallback selection available for missing, invalid or non-string confi
}
})
-
it('holds a configured or env feed base to the update-origin rule and refuses the rest', (): void => {
expect(resolveFeedBaseUrl('', undefined)).toBe('')
expect(resolveFeedBaseUrl('', ' ')).toBe('')
@@ -67,7 +66,11 @@ it('holds a configured or env feed base to the update-origin rule and refuses th
expect(resolveFeedBaseUrl('', 'https://mirror.example/updates')).toBe('https://mirror.example/updates')
expect(resolveFeedBaseUrl('', 'http://127.0.0.1:8443/feed')).toBe('http://127.0.0.1:8443/feed')
- for (const bad of ['http://evil.example/feed', 'https://user:[email protected]/feed', 'https://mirror.example/../feed']) {
+ for (const bad of [
+ 'http://evil.example/feed',
+ 'https://user:[email protected]/feed',
+ 'https://mirror.example/../feed'
+ ]) {
expect((): string => resolveFeedBaseUrl(bad, undefined)).toThrow()
expect((): string => resolveFeedBaseUrl('', bad)).toThrow()
}