share / share/sharedb

Is there any reason why Doc._handleOp does not check for an operation?

Open
#346 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
6.5k
Forks
456
Avg merge
1d 5h
Merged PRs (30d)
5

Description

In doc.js, why doesn't Doc.prototype._handleOp check to see if message.op is defined? If it isn't, it could end up calling _otApply on a message without an op keyword (but still increment this.version).

Happy to submit a PR if appropriate.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/client/doc.js at Doc.prototype._handleOp and trace its call to _otApply. Confirm the expected handling of messages without message.op and add coverage for the version behavior; done when that behavior is explicitly tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.