Sometimes, my mobile gets Particle.function return and Particle.publish event in reversed (ie. unexpected) order.
- Mobile calls Electron Particle.function
- Electron Particle.function raise a flag, then returns a number.
- Electron loop() see flag and does Particle.publish.
- mobile gets the return next.
- Then mobile gets the Pariticle.publish event.
Problem is sometimes:
4. mobile gets the Pariticle.publish event
5. mobile gets the return next
Mobile calls Particle.function to tell Electron to publish a record.
Electron normally responds to function by returning number of the record to be published, and then Electron publishes the record.
Normally, mobile gets return value = record number, and then gets publication of record, and can then verify expected record number.