A timeout is triggered whenever a new call to /messages is done.
From my understanding, if a user were to connect on 2 devices simultaneously, this would have the "dramatic" effect of causing them to flood the server with requests.
(Devices A and B)
A GET /message
B GET /message
A timeout triggered (because of B)
A GET /message
B timeout triggered (because of A)
B GET /message
A timeout triggered
...
The way it's designed, I don't see any simple solution to allow multiple client sharing the same username to run in parallel.
For now, I prevented the "dramatic" effect to happen with a simple fix.
We can have multiple long poll requests for each key instead of just one. So when new one is added with existing key, we let it be without bothering older one at all.
A
timeout
is triggered whenever a new call to /messages is done.From my understanding, if a user were to connect on 2 devices simultaneously, this would have the "dramatic" effect of causing them to flood the server with requests.
(Devices A and B)
The way it's designed, I don't see any simple solution to allow multiple client sharing the same username to run in parallel.
For now, I prevented the "dramatic" effect to happen with a simple fix.