uiwjs / uiwjs/react-codemirror

out of sync view state / uncatchable errors

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
161
PR merge metrics
No merged PRs in 30d

Description

in some cases, the view state seems to be out of sync. I am updating Decorations in an animation frame, and it can happen that the view dispatches from an old state, which can create errors. these errors also don't seem to be catchable with all I've tried.

I've made a minimal repro here:

https://codesandbox.io/s/react-codemirror-range-error-forked-pcpwtl?file=/src/App.js

I also wrote a post in the codemirror forum: https://discuss.codemirror.net/t/uncatchable-out-of-range-errors-when-document-changes/4864

This was all some time ago and I already found a workaround but today I ran into a similar problem again.

Not sure what to do about this..

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 problem in the linked CodeSandbox, focusing on src/App.js and the animation-frame updates to Decorations. Read the linked CodeMirror forum discussion for the reported out-of-sync view state and uncatchable errors. Done means the minimal reproduction no longer produces the reported errors or the failure is made catchable.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.