Skip to content
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

Bug: Bug in XML parsing gives internal error #109

Open
legsilva-legitimuz opened this issue Dec 3, 2024 · 1 comment
Open

Bug: Bug in XML parsing gives internal error #109

legsilva-legitimuz opened this issue Dec 3, 2024 · 1 comment

Comments

@legsilva-legitimuz
Copy link

About me

Working with MOS servers such as ARION and Sofie

Observed Behavior

A bug happening when integrate with MOS "Arion"

The issue starts with the error message being generated: MosDevice "anews.snews.tv_demo" not found, which is unrelated to the actual problem. I discovered this after manually editing the sofie-mos-connection code and adding some try/catch blocks at the points where the message is received, converted from an XML string into an object, and then processed.

I noticed that the XML was being received and converted into an object without issues. However, the object had a structure different from what the rest of the code expected, leading to an internal error in the library. From there, I investigated why the structure had changed.

As I understand it, the sofie-mos-connection library uses another library, xml-js, to convert XML into objects, and xml-js in turn relies on another library, sax. My suspicion at the time was that one of these two libraries had been updated over time, causing the sofie-mos-connection code to break—most likely xml-js.

If you check the version of these libraries in the yarn.lock file within the sofie-mos-connection GitHub project, you'll see that the versions used at the time of implementation were xml-js@npm:^1.6.11 and sax@npm:^1.2.4. Today, newer versions exist, and because of the caret (^) symbol before the version numbers, the exact versions specified won't necessarily be used. When you install the project dependencies, newer compatible versions may be fetched.

When I initially created my example code, I didn’t face this issue. However, after reproducing your setup and installing the dependencies from scratch, the problem occurred.

My proposed solution was to use Yarn to ensure it respects the yarn.lock file from sofie-mos-connection and downloads the same versions of the libraries that were used at the time of implementation, as this is precisely what the yarn.lock file is designed to address.

Expected Behavior

Sofe mos returns the correct message and convert accordingly the xml to ARION system

Version

4.1.0

Severity / Impact

Cant use some MOS events, such as: mosReqObjList, mosReqObj and others

@nytamin
Copy link
Contributor

nytamin commented Dec 4, 2024

Thank you for this bug report!

I'm not able to reproduce this issue, I tried manually updating the sax dependency to its latest version, 1.4.1 (xml-js is already at the latest available version, 1.6.11) and ran the unit tests, but they all seem to be OK.

Do you think you could provide some more info? For example, could you try setting the debug property to true, and past some of your console logs here?

@nytamin nytamin changed the title Receiving a bug inside sofie-mos node_modules Bug: Bug in XML parsing gives internal error Dec 5, 2024
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

No branches or pull requests

2 participants