Open ccampbell5 opened 1 month ago
Thanks for raising the issue, we will look at it asap 😉
Hello, I've looked at the issues:
About expects303Error
use case: I found out that without companions ads in the root vast, the 303 error is triggered as expected. Whereas with companion, it's not triggered anymore, it come from this condition https://github.com/dailymotion/vast-client-js/blob/5d148f75770aaca03edf64c0739d9523fad06293/src/parser/vast_parser.js#L443 Since companions are inside creative node, ad.creatives
won't be empty meaning the condition will not be met. We need to filter them out to know if we got an empty vast in the end.
About expectsThrowError
use case: here are the culprits https://github.com/dailymotion/vast-client-js/blob/5d148f75770aaca03edf64c0739d9523fad06293/src/parser/vast_parser.js#L420 that prevent rejecting the error and https://github.com/dailymotion/vast-client-js/blob/5d148f75770aaca03edf64c0739d9523fad06293/src/parser/vast_parser.js#L418 setting the wrong error code, it should be 102: VAST version of response not supported
We're going to fix it, but if you'd like a quick fix, feel free to contribute by opening a pull request! We'll be happy to look into it !
Hi, I'm using version 6.0.1 and noticing inconsistent behavior with the VASTClient in how it processes wrapper VASTs that contain errors. The following sample code contains two wrapper VASTs; expected vs actual behavior is indicated in comments. (Just swap the
test
constant.) Also attaching the package.json file. package.jsonexpects303Error
VAST is a two-layer wrapper that eventually points to an empty VAST document:<VAST xsi:noNamespaceSchemaLocation="vast.xsd" version="3.0"/>
. According to the docs, the error code for "No VAST response after one or more Wrappers" is 303. However, no 'VAST-error' event is emitted for this VAST.expectsThrowError
wrapper VAST points to an unsupported 1.0 VAST document; in this case, my understanding is that the VASTClient'sparseVAST
method should return a rejected Promise since the root element is not 'VAST'. However, the resulting promise is not rejected, and the parser emits a 'VAST-error' with the 301 (timeout) code. (If you follow the VASTAdTagURI link and copy the VAST 1.0 XML from there, then pass it toparseVAST
, then the expected rejected Promise is returned.)