Skip to content

AG-891: Use Record for split screen input playout contents#461

Merged
KvelaGorrrrnio merged 3 commits intomainfrom
AG-891/use-record-for-split-screen-input-playout-contents
Jan 7, 2026
Merged

AG-891: Use Record for split screen input playout contents#461
KvelaGorrrrnio merged 3 commits intomainfrom
AG-891/use-record-for-split-screen-input-playout-contents

Conversation

@KvelaGorrrrnio
Copy link
Contributor

@KvelaGorrrrnio KvelaGorrrrnio commented Jan 6, 2026

Context

This PR fixes the issue where inserting sources into an empty split screen box, other than the first one, crashes the Alba TV 2 server. The reason for this is a serialization-issue caused by a mismatch in types.
Alba server models the types for playout content for split screen inputs as a record, but the implementation uses arrays.

From this, the code

const inputPlayoutContents = []
inputPlayoutContents[3] = { type: 'CAMERA', ... }

will be serialized to

[null, null, null, { type: 'CAMERA', ... }]

Change description

The implementation is changed to using records instead of arrays.

Warning

This above change requires changes in Alba TV 2 server as that depends on the type to be a list - not a record.

Additionally, the playout content type attributes are marked as readonly as they are, and should, only be modified when created.

The package qs is also fixated to >=6.14.1 as to avoid the memory exhaustion DoS vulnerability found in previous versions.

Checklist

  • The changes are documented.
  • Core logic is covered by tests.

The playout content objects for split screen inputs were assigned to
a list instead of a record. This caused issues when serializing them.
E.g. inputPlayoutContents[4] = obj, would become '[null,null,null,null,obj]'.
@KvelaGorrrrnio KvelaGorrrrnio requested a review from a team as a code owner January 6, 2026 12:31
@KvelaGorrrrnio KvelaGorrrrnio changed the title Ag 891/use record for split screen input playout contents AG-891: Use Record for split screen input playout contents Jan 6, 2026
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Coverage Report for tv2/alba-server

Status Category Percentage Covered / Total
🔵 Lines 74.5% 2899 / 3891
🔵 Statements 74.32% 3028 / 4074
🔵 Functions 69.62% 832 / 1195
🔵 Branches 67.67% 741 / 1095
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/blueprints/domain/services/action-factories/tv2-split-screen-action-factory.ts 48.84% 20.4% 40.67% 48.81% 109-149, 270-288, 296, 360-461, 580-583, 611-700, 751-827
Generated in workflow #1394 for commit d86dc86 by the Vitest Coverage Report Action

@KvelaGorrrrnio KvelaGorrrrnio merged commit e52b3a3 into main Jan 7, 2026
4 checks passed
@KvelaGorrrrnio KvelaGorrrrnio deleted the AG-891/use-record-for-split-screen-input-playout-contents branch January 7, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants