Release v2.10.4
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile, web, pulse-signage-web) (push) Successful in 1m17s
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile.player, player, pulse-signage-player) (push) Successful in 31s

This commit is contained in:
2026-08-29 12:22:17 +01:00
parent 3f4f57020a
commit 9e07c6b306
24 changed files with 270 additions and 167 deletions
+53
View File
@@ -195,3 +195,56 @@ test('client command route forwards a single screen command', async () => {
assert.equal(calls[0].connectionId, undefined);
assert.equal(response.body.ok, true);
});
test('client command route uses the bridge device route without a public player URL', async () => {
const { app, handlers } = createAppHarness();
const calls = [];
registerScreenCommandRoutes(app, {
pool: {
async query(sql) {
if (String(sql).includes('SELECT id, name, slug FROM d_screens WHERE slug = ?')) {
return [[{ id: 1, name: 'Lobby', slug: 'lobby' }]];
}
return [[]];
}
},
common: { async fetchPlayerRegistrations() { return []; } },
forwardPlayerCommand() {
throw new Error('direct player fallback should not be used');
},
forwardPlayerCommandToBaseUrl() {
throw new Error('public URL fallback should not be used');
},
forwardPlayerCommandToDevice(deviceId, payload) {
calls.push({ deviceId, payload });
return { ok: true };
},
getScreenConnections: async () => ({
connections: [{ id: 'connection-1', deviceId: 'browser-tab-1', playerDeviceId: 'remote-player-1', playerPublicBaseUrl: null }]
}),
isClientNameAvailable() { return true; },
withClientNameReservation() {},
broadcastDashboardState() {},
requirePermission() {
return function (_req, _res, next) { next(); };
}
});
const response = {
statusCode: 200,
body: null,
status(code) { this.statusCode = code; return this; },
json(payload) { this.body = payload; return this; }
};
await handlers['/clients/:slug/commands'][1]({
params: { slug: 'lobby' },
body: { command: 'pause', connectionId: 'connection-1' },
query: {}
}, response, () => {});
assert.equal(response.statusCode, 200);
assert.deepEqual(calls, [{
deviceId: 'remote-player-1',
payload: { screenSlug: 'lobby', command: 'pause', connectionId: 'connection-1' }
}]);
});