How to monitor a provider's activity?

Is it possible to monitor

  • when a provider starts synchronizing (after a Y.Doc update),
  • the current synchronization progress and
  • when synchronization has finished?

The latter can be done by listening to 'sync[ed]' events - but only initially, not after the first update.

But what about the others?

My use case: synchronizing data over mobile connections when an application is started may take some time - and it is always good style to inform the user about progress, success and failure

Every provider is different. In my experience providers don’t always emit all the events needed for this level of monitoring.

For example, y-websocket only emits the following events:

  • connection-error
  • connection-close
  • status (disconnected, connected)
  • sync/synced

However it’s fairly easy to emit more events if you fork the provider.