How to integrate ypy-websocket with django channels (for websocket) and redis (as data store)

Metadata is never lost in Yjs. However, applying changes will remove content that is marked as deleted. So, after merging updates you are not able to restore old states. If you want to be able to restore old states (e.g. using Y snapshots), then you can simply disable garbage collection when merging updates (ydoc.gc = false).

Another option would be to use Y.mergeUpdates([update1, update2]) which will simply merge updates without performing garbage collection.