-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(vMix): fragmented message handling SOFIE-2932 #320
fix(vMix): fragmented message handling SOFIE-2932 #320
Conversation
I have not encountererd an XML message that would not end with newline, but if it's possible, the VMixResponseStreamReader needs changes
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## release50 #320 +/- ##
=============================================
+ Coverage 37.19% 37.60% +0.41%
=============================================
Files 105 106 +1
Lines 10220 10234 +14
Branches 2493 2496 +3
=============================================
+ Hits 3801 3849 +48
+ Misses 5868 5837 -31
+ Partials 551 548 -3 ☔ View full report in Codecov by Sentry. |
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 if we have any questions on this. |
About the Contributor
This PR is being opened on behalf of TV 2 Norge.
Type of Contribution
This is a:
Bug fix / Code improvement
Current Behavior
It could happen that incomplete XML message would be attempted to be processed by the 'data' event handler, causing an error to be thrown. As a result the old, incomplete data got indefinitely stuck in the
_unprocessedLines
of theBaseConnection
.New Behavior
The logic for processing incoming data is extracted, refactored and covered by unit tests.
Handling of messages that may be fragmented over multiple TCP packets is fixed.
Errors thrown during the message handler are no longer interrupting the processing.
When reconnecting, previous and possibly incomplete data is discarded.
Testing Instructions
Other Information
An assumption about the XML message being always terminated by a newline was made. This is not explicitly specified in the documentation, but the documentation says the following:
(source: https://www.vmix.com/help25/index.htm?TCPAPI.html)
Status