Bad any Extension's parser on old TVs.
rybakoven opened this issue · comments
On old LG TVs (2014, 2015), any is parsed incorrectly.
Parses normally when writing:
<Extension type="bannerId"><![CDATA[ 234 ]]></Extension>
And it always returns value=null when writing with a line break and a tab:
<Extension type="addClick">
<![CDATA[ 234 ]]>
</Extension>
For some reason, in parsing, children and other nonsense are enumerated, while, for example, MediaFiles uses correct parsing:
function parseNodeText(node) { return node && (node.textContent || node.text || '').trim(); }
VAST is sent by clients and no one can guarantee that the code in it will be adjusted without spaces for correct parsing.
On these TVs, version 4.0.0 is current, all others includes 4.0.1 returned: function is not defined.
Hello, thank you for reporting this issue !
It appears that every node, whether with or whithout line breaks, including Extensions
, is being parsed correctly when using a VAST file following the IAB specifications.
To ensure that your VAST is correctly parsed, you can test it on this parsing tester.
Don't hesitate to contact us if you have any further questions.
Hello!
There are no restrictions on line wrapping in the documentation.
The parser following the link displays the XML as valid.
In MediaFile, normal parsing is used, and in extensions, for some reason, passing through children, as I understand it, is for validation, but the attributes and values in extensions can be arbitrary.
Example parsing func from lib for MediaFile:
function parseNodeText(node) { return node && (node.textContent || node.text || '').trim(); }
I'm not sure to fully understand your issue, so to sum up, when within the VAST you have:
1 - <Extension type="bannerId"><![CDATA[ 234 ]]></Extension>
it's parsed as expected and returns a correct value
2 - But with breaklines and spaces as below you get a null value
<Extension type="banner">
<![CDATA[ 234 ]]>
</Extension>
In your latest answer using parsing tester (btw which use vast client and having the possibility to select any specific vast client version for your test) in your screenshots I do see it's not returning a null value as point 2 but it's working fine as point 1.
So I guess, if you've get null on tv this is definitely due to your environment, probably because old CTV are using a deprecated browser version, that doesn't behave as expected. How are you using the vast client ? Are you using the node.js version ? Because we don't have breaking changes when moving from 4.0.0 to 4.0.1, the only thing that could have an impact might be the dependency update from "xmldom": "^0.7.5"
to "xmldom": "^0.8.3"
The parser following your link returns the correct value if there is a line break, but the library does not.
The node is not used.
In the two cases it returns the correct value. As I told you the Ad Parsing Tester is using the library and is not altering results, it simply display the library result.
Can you give us a way to reproduce please with more informations about your environment ?
In the latest chrome - yes. And it doesn't tell me that line breaks are incorrect.
It’s hardly possible to run this parser on TVs 15 year, but if it works, there will be a null there, even though the XML is correct.
TVs from 14-15 years are still widely used and this behavior for VAST on them is incorrect, due to the over-complicated passage through the nodes in the parser, instead of a simple and understandable design.
Environment - LG Webos
I get your point, but it's hard to test all devices and stay retrocompatible for outdated versions. We strongly encourage you to contribute and open a PR that could fix your issue. For the next release this will be the browser-list:
"browserslist": [
"chrome >= 63",
"firefox >= 67",
"edge >= 79",
"safari >= 12.1"
],
what version of LG WebOs are you using ? Are you using the VAST-client pre-bundled, if so which one ? Or from npm ?