Skip to content

id for setTimeout and setInterval are prone to errors #36

Description

@luiza-cicone

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions