Are YJS observers meant to be idempotent?

@dmonad Kevin Jahns
Tue, 11 Nov 2025 12:33:12 +0000

Document updates (i.e. CRDT updates) are idempotent - meaning that Yjs doesn’t apply the same change twice. It can do that because all changes are uniquely addressed. I can simply filter out known changes.

I’m not sure how observers can be idempotent. Observers describe changes, you can’t really apply observer events. However, if you apply the described changes twice (e.g. insert “X” at position Y), you most definitely will duplicate content.