yjs / y-protocols

Yjs encoding protocols
MIT License
109 stars 39 forks source link

Additional field to awareness update/change event #23

Open mifopen opened 1 year ago

mifopen commented 1 year ago

It would be nice to have an additional field next to the existing added, updated, removed that contains client ids that were removed and now appear again. Something like resurrected.

For now, such clients appear either in updated array (for remote events) or in added array (for local events).

The motivation for this is that there are cases when you want to react only to changes in the set of clients and not a state of those (eg avatar list). For that, you could check for transaction.added > 0 || transaction.removed > 0 to do some work. But in case of disconnected and then connected again clients you wouldn't notice them as they are included in updated set.

mifopen commented 1 year ago

Hey! Is there any way we can help with it?