Skip to content

Data loss due to Pusher error #50

@helloiamlukas

Description

@helloiamlukas

Bug

When having a large document, live updates are chunked. The size of the chunk is set to 8000 characters.

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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions