Since I "predict" the next index of the packet, there could be a race condition happening. Tried this with debugging and halting the code and seems like it does, giving the frontend a totally wrong index causing wrong data being displayed.
Either:
Fix race condition (queue or something else)
Use something different than indexes to have a lookup-id for the frontend, which is race-condition "save"
Since I "predict" the next index of the packet, there could be a race condition happening. Tried this with debugging and halting the code and seems like it does, giving the frontend a totally wrong index causing wrong data being displayed.
Either: