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

feat(cozy-pouch-link): Add startReplicationWithDebounce() method #1553

Merged
merged 2 commits into from
Nov 6, 2024

Commits on Nov 4, 2024

  1. feat(cozy-pouch-link): Add startReplicationWithDebounce() method

    We want to be able to debounce calls to `startReplication()`
    
    This commit adds the `startReplicationWithDebounce()` method that is
    responsible to debounce the call of `startReplication()` by a specific
    delay
    
    The debounce delay can be configured using the CozyPouchLink
    constructor's `syncDebounceDelayInMs` option
    
    Calling the `startReplication()` will cancel debounced calls and
    immediately execute the replication
    Ldoppea committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    5e26fc6 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. feat(cozy-pouch-link): Add a syncDebounceMaxDelayInMs parameter

    In previous commit we added the possibility to debounce the
    `startReplication()` method and to configure the debounce delay with
    `syncDebounceDelayInMs` parameter
    
    This may be problematic as we expect to call this from realtime events
    that may, in some rare scenario, occur too often to trigger a single
    replication due to the debounce
    
    To prevent this we add the `syncDebounceMaxDelayInMs` parameter that
    will ensure that `startReplication()` is called when the max delay is
    reached even if realtime events trigger the debounce for too long
    Ldoppea committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    0c9557c View commit details
    Browse the repository at this point in the history