InteractiveAdvertisingBureau / SIMID

Secure Interactive Media Interface Definition (SIMID)
https://interactiveadvertisingbureau.github.io/SIMID/
Apache License 2.0
47 stars 25 forks source link

messageId_ increment not thread safe #147

Closed advir1 closed 5 years ago

advir1 commented 5 years ago

https://github.com/InteractiveAdvertisingBureau/SIVIC/blob/5af81aa12157e4d4377455e7ba73fda184c3de52/examples/sivic_protocol.js#L41

Should be: const messageId = this.nextMessageId_++;

ryanthompson591 commented 5 years ago

Ah good catch, this will definitely be asynchronous. I wonder if just putting the incrementation on a single line is adequate or if this needs some form of await/mutex.

I'm going to do this in a separate PR.