Is there a Yjs way of sending a "Notification"

Hi folks,

Been trying to figure out if there is an Yjs way of doing a notification kind of action, it’s kinda like an awareness update only that this one should be consumed by other peers for only one time.
This is useful for syncing actions like version roll back event and show a notification on the peer side, or basically any event you would like to broadcast and show a message.
The reason awareness update event wouldn’t have worked nicely is because I also use it to sync cursor position, I’ll have to clear the notification flag right after I set it to avoid showing message multiple times – cause cursor movements also trigger that.
I think my approach is not likely the best way to do it, any suggestions?

Thank you!

Instead of toggling a boolean flag I suggest you increment some kind of counter.

The “Yjs way” is to compute events from state that changes. There could be a “reset” counter that is incremented every time there is a version roll back. The client would render a notification whenever it changes. This also prevents the unlikely case that there are two rollbacks - you usually only want to render one notification.

Gotcha, instead of awareness, use the shared data.
I’ll have to send user information along with the counter, but guess that’s affordable.
Thank you!