Always include a requested activation in the connection PATCH - #163
Open
ZayanKhan-12 wants to merge 2 commits into
Open
Always include a requested activation in the connection PATCH#163ZayanKhan-12 wants to merge 2 commits into
ZayanKhan-12 wants to merge 2 commits into
Conversation
The PATCH body is built from the differences between the staged endpoint response and the intended staged values, but the activation object in a PATCH is a request rather than staged state. When a receiver's staged endpoint already reported the same activation values (e.g. a node that initializes staged activation.mode to "activate_immediate"), the differences omitted the activation object entirely, so pressing Activate in the Connect tab or activating from Staged/Edit sent a PATCH with no activation and nothing happened. Include the activation object whenever a mode is set, even if the staged endpoint already reported the same values. A null mode is still only sent when it results from an actual difference, so pending activations are not unintentionally cancelled. Fixes sony#97 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
As pointed out in #97, the bug is in the Receiver in that case, not nmos-js, so needs further discussion about whether to include this workaround in nmos-js. |
garethsb
approved these changes
Jul 29, 2026
garethsb
left a comment
Contributor
There was a problem hiding this comment.
I think by expanding the comment slightly, the rationale is a bit clearer. Then, seems OK to me. Thanks for the contribution.
Comment on lines
+571
to
+574
| // the activation object in a PATCH requests an activation, rather | ||
| // than reflecting staged state, so when a mode is set, include it | ||
| // even if the staged endpoint already reported the same values, | ||
| // which otherwise leaves it out of the differences (see #97) |
Contributor
There was a problem hiding this comment.
Suggested change
| // the activation object in a PATCH requests an activation, rather | |
| // than reflecting staged state, so when a mode is set, include it | |
| // even if the staged endpoint already reported the same values, | |
| // which otherwise leaves it out of the differences (see #97) | |
| // Activation in a PATCH is a request, not staged state. Include it whenever | |
| // the request has a non-null mode, even if GET /staged already reported the | |
| // same values (otherwise deep-diff omits it). That also covers non-conformant | |
| // devices that leave activate_immediate on /staged (see #97). A null mode is | |
| // only sent when it appears in the differences, so unrelated edits do not | |
| // cancel a pending activation. |
…ed in the PATCH Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #97
Root cause
Exactly as suspected in the issue discussion: the
UPDATEcase indataProvider.jsbuilds the PATCH body fromdeep-diff(previousData.$staged, data.$staged). The activation object in an IS-05 PATCH is a request, not staged state — but when a receiver's staged endpoint already reports the same activation values (e.g. a node that initializes stagedactivation.modeto"activate_immediate", as in the reporter's setup), the diff contains no activation entries, so the Connect tab's Activate button and Staged/Edit immediate activation send a PATCH with noactivationobject, and nothing activates.Minimal repro of the mechanism (deep-diff 1.0.2, same as the lockfile):
Fix
After building
patchDatafrom the differences, includedata.$staged.activationwhenever itsmodeis non-null. A null mode is deliberately not force-included: it is still only sent when it results from an actual difference, so pending scheduled activations are not unintentionally cancelled by unrelated edits.Verification
yarn lint-checkcleanyarn buildsucceeds (production build)makeConnection.jsConnect-tab activation and Staged/Edit) — both now always carryactivationin the PATCH body when a mode is chosen🤖 Generated with Claude Code