Closed EricHasegawa closed 9 months ago
+1
I think you just have to disable gc on the server as well, have you tried this?
new Hocuspocus({yDocOptions: {gc: false}})
alternatively, you can do this when loading the ydoc from storage:
ydoc.gc = false
This worked!! Thanks - had no idea this existed
😎 just want to drop here that I wouldn't recommend doing this in the long run, as this will lead to an ever-growing history in the ydoc and will increase the memory and cpu requirements a lot (depending on how big the history got).
So, be careful ;)
Description On the frontend of my editing app, I instantiate a
new HocuspocusProvider
, passing in ayjsDoc
withgc: false
. I can log this on my front-end and confirm garbage collection is indeed turned off. When the doc gets sent to my server (either throughstore
on a theDatabase
extension or through the genericonStoreDocument
, the passed in document hasdocument.gc = true
. This is preventing me from properly showing version snapshots :(Steps to reproduce the bug Steps to reproduce the behavior:
gc
to false.onStore
oronStoreDocument
, logdocument.gc
, see that it is set totrue
. If you try to do something likeY.createDocFromSnapshot
an error will be thrown.Expected behavior The document comes into the server and has
gc
set to false.Environment?
Please let me know if there's a way around this or if there's anything I'm doing wrong!