fix(qconnect): restore local repeat renderer flow

cx
This commit is contained in:
vicrodh committed 2026-03-14 13:09:23 -06:00
1 parent f47f691063
commit 8a468ed725
4 files changed
+125 -19

No files matched your search

+23
View File
@@ -6,6 +6,7 @@ import {
isQconnectPeerRendererActive,
isQconnectRemoteModeActive,
resolveQconnectPlayNextAuthoritativeTrackId,
shouldQconnectSuppressLocalPlaybackAutomation,
type QconnectConnectionStatus
} from './qconnectRuntime';
import type { QconnectQueueSnapshot, QconnectRendererSnapshot } from './qconnectRemoteQueue';
@@ -182,6 +183,28 @@ describe('QConnect runtime state helpers', () => {
).toBe(true);
});
it('suppresses local playback automation only when a peer renderer is active', () => {
expect(
shouldQconnectSuppressLocalPlaybackAutomation(true, {
session_uuid: 'session-1',
active_renderer_id: 4,
local_renderer_id: 11,
renderers: []
})
).toBe(true);
expect(
shouldQconnectSuppressLocalPlaybackAutomation(true, {
session_uuid: 'session-1',
active_renderer_id: 11,
local_renderer_id: 11,
renderers: []
})
).toBe(false);
expect(shouldQconnectSuppressLocalPlaybackAutomation(false, null)).toBe(false);
});
it('does not trust the local current track for play next when a peer renderer is active', () => {
expect(
resolveQconnectPlayNextAuthoritativeTrackId({
+7
View File
@@ -194,6 +194,13 @@ export function isQconnectPeerRendererActive(
return activeRendererId !== localRendererId;
}
export function shouldQconnectSuppressLocalPlaybackAutomation(
connected: boolean,
sessionSnapshot: QconnectSessionSnapshot | null | undefined
): boolean {
return connected && isQconnectPeerRendererActive(sessionSnapshot);
}
export function resolveQconnectPlayNextAuthoritativeTrackId(params: {
sessionSnapshot: QconnectSessionSnapshot | null | undefined;
localCurrentTrackId: number | null | undefined;