You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so that if resolvedAds fails and we have remainingAds, can be proceeded with them.
The text was updated successfully, but these errors were encountered:
shubham-si
changed the title
Bug: Fallback not working if top Ad Elements returns empty Vast in case of multiple Ad Elements
Bug: Fallback not working if top Ad Elements returns empty Vast or fails in case of multiple Ad Elements
Jan 12, 2024
https://github.com/dailymotion/vast-client-js/blob/master/src/parser/vast_parser.js#L461C25-L461C25
const resolvedAds = util.flatten(unwrappedAds);
default to[]
Linkif (!resolvedAds && this.remainingAds.length > 0) {
There seems to be a issue here
!resolvedAds
. Since!Array<T>
givesfalse
always, thus the code within if will not be executed at all.So If any Ad element (going from top to bottom) fails to fetch xml or return empty vast, it will not fallback to next Ad Element.
Fix:
if (resolvedAds.length === 0 && this.remainingAds.length > 0) {
so that if resolvedAds fails and we have remainingAds, can be proceeded with them.
The text was updated successfully, but these errors were encountered: