Skip to content

RFE: A way to know if/when at least one sync has happened #1045

@aboodman

Description

@aboodman

People often want to know when the fist sync round trip has happened. One common reason for this is to initialize state with some default data. Waiting for onSync(true) sort of works except:

  • if the client already has local state, this is needlessly slow
  • it doesn't work at all in the offline case - onSync(true) will fire even if the first sync was unsuccesful, leading the app to incorrectly add the default data

The simplest way I can think of to accomplish this is to add a promise like firstServerResponse: Promise<void>. If the client knows it has already had one server response, it can resolve this immediately, otherwise it can wait.

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