Object extensible error
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.5k
- Forks
- 456
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 5
Description
I honestly have no clue why this is happening. Here is how my stack works:
- The server creates a new doc, which is an empty list.
doc.create([], err => { if (err) console.log(err) })
- The client, after doing something, pushes to this list using a json0 op
doc.submitOp({ p: [0], li: "new-item" })
- The client gets an error
TypeError: Cannot add property 0, object is not extensibleat Array.splice in json0 - However, if I try again right away, it works for all subsequent ops.
- But other clients that are subscribed get the same error when the op gets broadcasted, so there seems to be something about the doc itself that is causing this.
This doesnt seem to happen when I create a doc on the client side and apply the same op to it. Is there anything special I need to do when creating the doc on the server side?
I have no clue where even to begin with this. Where in the ShareDB stack is Object.preventExtensions() being called? Does this have something to do with the websocket configuration?
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 by reproducing the server-created empty-list flow described in the issue, comparing it with client-side creation. Trace the json0 operation through Array.splice and the broadcast to subscribed clients, then determine where the non-extensible object is introduced. Done means identifying the cause and the required server-side setup or configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100