Understand SyncStatus and the sync-status event
masterWhen using compatible backends (like yhub), you can monitor detailed synchronization state via the sync-status event or the wsProvider.syncStatus property.
SyncStatus Object Properties:
connected:boolean- Whether the provider is connected to the server.receivedInitialSync:boolean- Whether the initial sync with the server has completed.localUpdatesSynced:boolean- Whether all local updates have been confirmed by the server.localUpdatesAge:number- Age in ms of the oldest unconfirmed local update (0 if all synced).lastMessageAge:number- Time in ms since the last message was received from the server.status:'green' | 'yellow' | 'red'- A distilled status:'green': Connected, synced, and no unconfirmed local updates.'yellow': Connected but has unconfirmed local updates younger than 8 seconds.'red': Disconnected, not synced, or unconfirmed local updates older than 8 seconds.