Closed ikibkilam closed 1 year ago
Automerge.applyChanges
takes an array of Uint8Arrays, not just a single Uint8Array. Try changing the last line to:
[docRef.current] = Automerge.applyChanges(docRef.current, [message]);
I've made an API usability tweak in 0377389a995e49e575b72e0f6437ea5bc9603aa6: it now throws a more useful error message if you pass the wrong type of object to applyChanges()
.
I keep getting "TypeError: Not a byte array: 133" error, when UserA sends data to UserB, via socketIO. The relevant code snippets and outputs are below.
Code
Output
Crash Message
I thought maybe it was the base64 package I am using, so I used two other packages instead (base64-arraybuffer and js-base64), and continue to see the same error. In receiveMessage(), message is an instance of Uint8Array, though I have not shown the code to maintain clarity. Last, although it has been a while, I believe my code was working prior to getChanges() returning a bytearray. I am clearly not doing something right. Any assistance is very appreciated.