Skip to content

Fix macro download transfer type#188

Merged
Julusian merged 1 commit intoSofie-Automation:mainfrom
casperboone:macro-download-fix
Feb 6, 2026
Merged

Fix macro download transfer type#188
Julusian merged 1 commit intoSofie-Automation:mainfrom
casperboone:macro-download-fix

Conversation

@casperboone
Copy link
Contributor

@casperboone casperboone commented Feb 6, 2026

About the Contributor

In this case, the PR is on behalf of myself ;)

Type of Contribution

This is a:

Bug fix

Current Behavior

I ran into the same issue as described in #180. The macro downloads were not working and resulting in "Invalid download".

New Behavior

I investigated the differences with LibAtem, and found that the data transfer type is set incorrectly. In LibAtem the parameter is called "Unknown": https://github.com/LibAtem/LibAtem/blob/dc679b113b1c7be436a88e277ffc7e2f0b80d992/LibAtem/Net/DataTransfer/DownloadMacroJob.cs#L51C27-L51C33

I tested if Unknown2 is also needed, but I didn't see any difference in the results, so I'm assuming no.

Testing Instructions

const atem = new Atem()
atem.connect('...')
atem.on('connected', async () => {
  const macroContents = await atem.downloadMacro(1)
   await atem.uploadMacro(2, 'Also macro 1', macroContents)
})

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

Fix macro download transfer type

This PR fixes failed macro downloads that were resulting in "Invalid download" errors. The fix involves correcting the data transfer type used when initiating macro downloads to match the value used by LibAtem.

Changes made

  • src/dataTransfer/dataTransferDownloadMacro.ts: Updated the transferType field in the DataTransferDownloadRequestCommand initialization from 3 to 0x03fe (1022 in decimal)
  • src/dataTransfer/tests/download-macro-sequence.json: Updated the test fixture to reflect the corrected transfer type value of 1022

Testing

The PR includes a usage example demonstrating the fix:

const atem = new Atem()
atem.connect('...')
atem.on('connected', async () => {
  const macroContents = await atem.downloadMacro(1)
  await atem.uploadMacro(2, 'Also macro 1', macroContents)
})

Note: Review checklist items remain unchecked (PR readiness, author testing, unit tests, documentation updates).

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

The changes update the transferType value from 3 to 1022 (represented as 0x03fe in hexadecimal) in both the download macro implementation and its corresponding test fixture, ensuring consistency between the source code and test data.

Changes

Cohort / File(s) Summary
Download Macro Transfer Type Update
src/dataTransfer/__tests__/download-macro-sequence.json, src/dataTransfer/dataTransferDownloadMacro.ts
Updated transferType value from 3 to 1022 (0x03fe) in the startTransfer command payload across both implementation and test fixture.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A transfer type, once just three,
Now dons hexadecimal's spree—
From 0x03 to 0x03fe,
The macro hops with unity! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix macro download transfer type' directly and specifically summarizes the main change: correcting the transfer type value used for macro downloads, which aligns with the PR's core objective of fixing failed macro downloads.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Julusian Julusian merged commit d2ec516 into Sofie-Automation:main Feb 6, 2026
9 checks passed
@Julusian
Copy link
Member

Julusian commented Feb 6, 2026

This is publishing now as v3.8.1

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