-
Notifications
You must be signed in to change notification settings - Fork 14
Data loss due to Pusher error #50
Description
Bug
When having a large document, live updates are chunked. The size of the chunk is set to 8000 characters.
collaboration/resources/js/Workspace.js
Line 381 in ecb5200
| const chunkSize = 8000; |
In certain cases this causes updates not to be broadcasted, as the maximum message size of 10kb is exceeded. This error neither shows up in the editor, nor in the console.
This can lead to data loss: As editors will not be able to see changes by others, they might overwrite their content by saving the document.
By turning on Pusher logs via Pusher.logToConsole = true; it is possible to see the full error message
Pusher : Event recd : {"event":"pusher:error","data":{"code":null,"message":"The data content of this event exceeds the allowed maximum (10240 bytes). See https://pusher.com/docs/channels/server_api/http-api#publishing-events for more info"}}
Solution
An easy solution for this would be to decrease the chunk size.
collaboration/resources/js/Workspace.js
Line 381 in ecb5200
| const chunkSize = 8000; |
Since one character can have up to 4 bytes, the safest would be to set the chunk size from
8000 to 2500.