We have found a particular situation under which multi-part data from a webhook response becomes corrupt. Specifically, if there is a delay in the main loop (few hundred milliseconds) after a chunk of data is received, followed by a (different, unrelated) particle.Publish() call, the next chunk of data received will be corrupted (strange characters in buffer). This situation only occurs when the system thread is enabled. We tested and observed it under versions 0.6.0 and 0.5.1 of the system firmware. The bug does not occur with only a delay and without the particle.Publish call, and appears to be sensitive to timing/delay with which the particle.Publish call occurs.
It is possibly related to problem described here, but copying immediately to a different buffer does not help our problem: System thread and subscribe with multipart reply
Do you have any suggestions for dealing with this issue? Thanks!