share / share/sharedb

use fetchSnapshot api find this error “ShareDBError: Cannot normalize legacy json0 op”

Open
#531 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

ShareDBError: Cannot normalize legacy json0 op
at Object.exports.applyOps (D:\project\bytestorm-project\document-project\ot-server\node_modules\sharedb\lib\ot.js:171:16)
at Backend._buildSnapshotFromOps (D:\project\bytestorm-project\document-project\ot-server\node_modules\sharedb\lib\backend.js:839:18)
at D:\project\bytestorm-project\document-project\ot-server\node_modules\sharedb\lib\backend.js:767:15
at D:\project\bytestorm-project\document-project\ot-server\node_modules\sharedb-mongo\index.js:472:7
at D:\project\bytestorm-project\document-project\ot-server\node_modules\mongodb\lib\utils.js:704:5
at handleCallback (D:\project\bytestorm-project\document-project\ot-server\node_modules\mongodb\lib\utils.js:109:55)
at D:\project\bytestorm-project\document-project\ot-server\node_modules\mongodb\lib\cursor.js:854:66
at D:\project\bytestorm-project\document-project\ot-server\node_modules\mongodb\lib\utils.js:704:5
at D:\project\bytestorm-project\document-project\ot-server\node_modules\mongodb\lib\cursor.js:939:9
at Cursor._endSession (D:\project\bytestorm-project\document-project\ot-server\node_modules\mongodb\lib\core\cursor.js:404:7)
Error: Cannot normalize legacy json0 op
at wrapErrorData (D:\project\bytestorm-project\document-project\ot-server\node_modules\sharedb\lib\client\connection.js:263:13)
at Connection.handleMessage (D:\project\bytestorm-project\document-project\ot-server\node_modules\sharedb\lib\client\connection.js:191:11)
at StreamSocket.socket.onmessage (D:\project\bytestorm-project\document-project\ot-server\node_modules\sharedb\lib\client\connection.js:142:18)
at D:\project\bytestorm-project\document-project\ot-server\node_modules\sharedb\lib\stream-socket.js:60:12
at processTicksAndRejections (internal/process/task_queues.js:79:11) {
code: 'ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED',

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 by reproducing the failure through the fetchSnapshot API, then inspect sharedb/lib/ot.js at applyOps and sharedb/lib/backend.js at _buildSnapshotFromOps, as identified in the stack trace. Trace the stored operations returned through sharedb-mongo and define completion as fetchSnapshot handling the affected data without the legacy json0 normalization error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.