When a chunk exceeds the JSON.stringify max length, the stream errors out.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.5k
- Forks
- 456
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 5
Description
Currently, every chunk is stringified before passing the message over. When the chunk is too big for the JSON.stringify method, this will cause the _write function to error out.
https://github.com/share/sharedb/blob/master/lib/stream-socket.js#L60
A workaround for this is to wrap line 60 in a try catch block and instead pass the chunk as it exists before stringifying.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/stream-socket.js at line 60 and trace how _write stringifies each chunk before passing the message onward. Reproduce the failure with a chunk exceeding JSON.stringify's maximum length, then verify that the stream no longer errors and passes the chunk in its existing form when stringification fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100