Open-Measurement-JSClients
Open-Measurement-JSClients copied to clipboard
id for setTimeout and setInterval are prone to errors
Hello,
We are using the verification client setTimeout method to compute a custom viewability.
As it is using an internal generation of id's (starting at 0) it is prone to errors as it is using a falsy value and so we need to explicitly check against undefined
if (timeoutId !== undefined) { ... } instead of if(timeoutId) { ... }
I can suggest a PR where we change the id returned to start at 1. WDYT? https://github.com/InteractiveAdvertisingBureau/Open-Measurement-JSClients/blob/master/src/verification-client/verification-client.js#L381
Thanks!