Open georgewsu opened 6 months ago
Alternative steps to reproduce:
https://github.com/georgewsu/automerge-client-test/tree/file_error
git checkout file_error
gunzip generated.json.gz
mkdir -p dist
cp generated.json dist/data.json
npm install
npm run client
This branch creates a doc from json file contents. The generated json file was created using https://json-generator.com/ with repeat 10000, 10000.
I haven’t had a chance to verify this myself, but it looks as though you are passing an automerge document in to Repo.create()
.
create
should be used without parameters to create an empty doc handle, or with an object to initialise the document handle structure.
Essentially, you might have better luck if you skip the from
call and pass testJson
directly in to create
.
I haven’t had a chance to verify this myself, but it looks as though you are passing an automerge document in to
Repo.create()
.
create
should be used without parameters to create an empty doc handle, or with an object to initialise the document handle structure.Essentially, you might have better luck if you skip the
from
call and passtestJson
directly in tocreate
.
Hi, unfortunately that still doesn't prevent the error from happening. It does save a step and reduce the time it takes at least. Thanks
To clarify, it takes multiple documents to trigger the error on the server:
cd automerge-client-test
git checkout file_error
du -sh dist/data.json ; echo "should be several MB"
for i in {1..10}; do npm run client; done
fyi, the error message "recursive use of an object detected which would lead to unsafe aliasing in rust" is being thrown from the call to rollback
and obscuring the actual underlying error
you can test it out by wrapping the call to state.handle.rollback()
in a try/catch block
Changed issue title from "Error: recursive use of an object detected which would lead to unsafe aliasing in rust" to "Out of memory errors after creating enough large documents in repo"
Same issue as https://github.com/automerge/automerge-repo/issues/358
Hi, running in to this error when testing an automerge client with a 10MB test document.
Node.js v18.15.0
Steps to reproduce:
Start the sync server
Then run the client https://github.com/georgewsu/automerge-client-test/tree/error_recursive_use
code excerpt: https://github.com/georgewsu/automerge-client-test/blob/error_recursive_use/src/client.ts
Result: