experimenter icon indicating copy to clipboard operation
experimenter copied to clipboard

Race condition in JSON editor: Calls to EditorView.update are not allowed while an update is in progress

Open data-sync-user opened this issue 1 year ago • 1 comments

A race condition can cause the branches page to crash.

STR:

  1. Load an experiment branches page that is already configured with a feature value
  2. Click into the rich feature editor
  3. click outside the rich feature editor

This sometimes causes the page to crash, but only seems to happen near the end of page load. I’m not able to reproduce this 100% of the time. This error will likely go away when we migrate away from React.

┆Issue is synchronized with this Jira Bug

data-sync-user avatar Sep 13 '23 17:09 data-sync-user

➤ Barret Rennie commented:

stack trace hits this call site: https://github.com/codemirror/view/blob/b75e07590c759d0cf9cf1427cfcbd0c35da7cecc/src/editorview.ts#L240 ( https://github.com/codemirror/view/blob/b75e07590c759d0cf9cf1427cfcbd0c35da7cecc/src/editorview.ts#L240 )

We might be able to work around this in our event handlers by checking view.updateState and debouncing the call if we are updating

data-sync-user avatar Oct 18 '23 22:10 data-sync-user