Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve step queue during reconnect #5126

Merged
merged 5 commits into from
Dec 18, 2023

Commits on Dec 18, 2023

  1. fix(sync): preserve queue if sendRemainingSteps fails

    During a network disconnect
    Yjs-websocket notices missing awareness messages and closes the connection.
    In this case the remaining steps can also not be send out and the request fails.
    Preserve the queue so we can use it once the network is back up.
    
    Signed-off-by: Max <max@nextcloud.com>
    max-nextcloud committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    fdd77ef View commit details
    Browse the repository at this point in the history
  2. fix(sync): keep queue around during reconnects

    When yjs does not receive awareness updates
    it will close and reopen the websocket.
    Keep the content of the queue, i.e. the outgoing steps
    so they can be send out once the connection is back.
    
    Signed-off-by: Max <max@nextcloud.com>
    max-nextcloud committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    e757c16 View commit details
    Browse the repository at this point in the history
  3. fix(sync): ensure queue stays the same array

    Change the content of `queue` with `queue.splice`
    rather than setting `queue` to another array.
    
    Signed-off-by: Max <max@nextcloud.com>
    max-nextcloud committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    d9faf1c View commit details
    Browse the repository at this point in the history
  4. fix(sync): only clear queue after successful send

    Also add a unit test for the websocket polyfill
    
    Signed-off-by: Max <max@nextcloud.com>
    max-nextcloud committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    1911a14 View commit details
    Browse the repository at this point in the history
  5. fix(sync): clear old providers on reconnect

    avoids the old provider leaking error events.
    
    Signed-off-by: Max <max@nextcloud.com>
    max-nextcloud committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    a90b7f0 View commit details
    Browse the repository at this point in the history