diff --git a/apps/desktop/electron/connection-config.ts b/apps/desktop/electron/connection-config.ts index 1ed729a436..47e1141484 100644 --- a/apps/desktop/electron/connection-config.ts +++ b/apps/desktop/electron/connection-config.ts @@ -280,8 +280,10 @@ function remoteRequestMatchesBaseUrl(requestUrl, baseUrl) { const request = new URL(requestUrl) const base = new URL(baseUrl) const basePath = base.pathname.replace(/\/+$/, '') + const requestProtocol = request.protocol === 'ws:' ? 'http:' : request.protocol === 'wss:' ? 'https:' : request.protocol + const baseProtocol = base.protocol === 'ws:' ? 'http:' : base.protocol === 'wss:' ? 'https:' : base.protocol if (requestProtocol !== baseProtocol || request.host !== base.host) { diff --git a/apps/desktop/src/app/contrib/hooks/use-session-tile-delegate.ts b/apps/desktop/src/app/contrib/hooks/use-session-tile-delegate.ts index 3ac9b8814c..ce4783cb7a 100644 --- a/apps/desktop/src/app/contrib/hooks/use-session-tile-delegate.ts +++ b/apps/desktop/src/app/contrib/hooks/use-session-tile-delegate.ts @@ -122,11 +122,7 @@ export function useSessionTileDelegate({ // transcript or a stale pre-reconnect survivor; reusing it painted the // post-sleep/wake tile permanently empty. Fall through to a real // resume instead — it's idempotent for a genuinely live session. - if ( - existing && - cached?.storedSessionId === storedSessionId && - (cached.busy || cached.messages.length > 0) - ) { + if (existing && cached?.storedSessionId === storedSessionId && (cached.busy || cached.messages.length > 0)) { publishSessionState(existing, cached) return existing diff --git a/apps/desktop/src/store/session-states.test.ts b/apps/desktop/src/store/session-states.test.ts index edfaedf6e6..9620f8404a 100644 --- a/apps/desktop/src/store/session-states.test.ts +++ b/apps/desktop/src/store/session-states.test.ts @@ -38,7 +38,9 @@ describe('resetTileRuntimeBindings', () => { resetTileRuntimeBindings() expect(invalidateRuntimeBindings).toHaveBeenCalledTimes(1) - expect($sessionTiles.get()).toEqual([{ anchor: undefined, before: undefined, dir: undefined, storedSessionId: 'stored-a' }]) + expect($sessionTiles.get()).toEqual([ + { anchor: undefined, before: undefined, dir: undefined, storedSessionId: 'stored-a' } + ]) }) it('tolerates a delegate without invalidateRuntimeBindings (older wiring)', () => {