Mutation observer for "onChange" event is re-enabled to early when loading large document
@frankwalter-1 がすでに取り組んでいます。
2024年12月31日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
非同期の render() パスと MutationObserver のライフサイクル、特に isMutationBelongsToElement() から調査を開始し、Chrome でプロファイリングを行いながら大きなドキュメントで問題を再現してください。完了条件は、レンダリングが完全に完了するまで observer が非アクティブなままであり、説明されている繰り返しの呼び出しや CPU 負荷が発生しないことです。
索引モデルが issue の本文から書いたものです。
説明
When replacing the editor contents by calling "render()" the MutationObserver that detects changes should be deactivated and reactivated after the new content has been rendered. It seems the async render() method just uses a 2000ms timer, so when a document takes longer to render the MutationObserver is re-enabled too early and there are hundreds of calls to "isMutationBelongsToElement()" that bay continue multiple seconds and creating 100% cpu load.
Steps to reproduce:
- load a document using render()
- load another very lange document using render()
- look at the Chrome performance monitor or record a performance profile and look at the many calls.
Expected behavior:
when rendering a new document the Editor makes sure that the new content has been fully rendered before re-activating the MutationObserver.
Editor.js version:
2.30.6
Plugins you use with their versions:
not relevant
- 主要言語
- TypeScript
- スター
- 32k
- フォーク
- 2.2k
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codex-team/editor.js のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
codex-team/editor.js#3037 ·
-
Floating Promise Anti-Pattern & Premature Caret in Multi-Block Paste対応中かも @anshurajbisoyi98-ctrl が 14 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
codex-team/editor.js#3032 · コメント 1 件 ·
-
Silent Data Loss & Broken Error Contract in Saver.save()対応中かも @Sion612 が 24 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
codex-team/editor.js#3030 ·
-
Complete Omission of block.destroy() in Blocks Collection対応中かも @Minhal128 が 23 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
codex-team/editor.js#3029 ·
-
Bug: Link cannot be removed対応中かも @prathmeshyelne が 130 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
codex-team/editor.js#3005 · コメント 1 件 ·
codex-team/editor.js の issue をすべて見る
似ている issue
-
backend priority:P3 privacy-fix
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug desktop v3 windows
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
esengine/DeepSeek-Reasonix#13697 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:security documentation effort:S priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
app:web meta:ops
難易度 2/5 半日 初心者へのやさしさ 78/100
osu-tournament-rating/otr#1113 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100