Closed nytamin closed 8 months ago
Attention: 77 lines
in your changes are missing coverage. Please review.
Comparison is base (
8591c99
) 78.17% compared to head (aca05c3
) 77.21%. Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hello!
Thank you for contributing to the Sofie Project!
If you haven’t already, please give our contribution guidelines a read. We will reach out to you to schedule an initial discussion regarding this (more details to follow).
We don't think we need a discussion on this. More leeway for not-entirely MOS-compliant systems seems a good idea.
About the Contributor
This PR is posted on behalf of SuperFly.tv
Type of Contribution
This is a: Code improvement. An attempt at making mos-connection better at handling off-spec messages.
This PR is another try at fixing the issues behind #84
Current Behavior
If we receive a message that is not according to the specification, like for example if calling
await mosDevice.requestMachineInfo()
and receiving the reply<listMachInfo>
:<time>
is missing: Returns an object wheretime
is populated with a MosTime with valueDate.now()
<time>
is empty: Throws withError: MosTime: Invalid input: \"[object Object]\"
<time>
is badly formatted: Throws withError: MosTime: Invalid timestamp: \"BAD DATA\"
<opTime>
is missing: Returns an object wheretime
is populated with a MosTime with valueDate.now()
<opTime>
is empty: Throws withError: MosTime: Invalid input: \"[object Object]\"
<opTime>
is badly formatted: Throws withError: MosTime: Invalid timestamp: \"BAD DATA\"
Why this is bad:
(Note: According to the MOS protocol,
<time>
is required and<opTime>
is optional.)<time>
is real or fictional (like in 1 or 4).New Behavior
If calling
await mosDevice.requestMachineInfo()
:If in strict mode:
<time>
is missing: Throws withError: MosTime: Invalid input: "undefined"
<time>
is empty: Throws withError: MosTime: Invalid input: "undefined"
<time>
is badly formatted: Throws withError: MosTime: Invalid timestamp: "BAD DATA"
<opTime>
is missing: Returns an object whereopTime
isundefined
.<opTime>
is empty: Returns an object whereopTime
isundefined
.<opTime>
is badly formatted: Throws withError: MosTime: Invalid timestamp: "BAD DATA"
If in non-strict mode:
<time>
is missing: Returns an object where thetime
field is populated with a MosTime with value0
<time>
is empty: Returns an object where thetime
field is populated with a MosTime with value0
<time>
is badly formatted: Throws withError: MosTime: Invalid timestamp: "BAD DATA"
<opTime>
is missing: Returns an object whereopTime
isundefined
<opTime>
is empty: Returns an object whereopTime
isundefined
<opTime>
is badly formatted: Throws withError: MosTime: Invalid timestamp: "BAD DATA"
Testing Instructions
Basic regression testing should be enough.
Other Information
Status