Symptom:
After the recent architecture changes (#8149), the Monaco Editor wrapper started throwing:
Error: Element already has context attribute: neo-monaco-editor...
This indicates monaco.editor.create(node, ...) is being called twice on the same DOM element.
Immediate Fix:
Made Neo.main.addon.MonacoEditor.createInstance idempotent by adding a check:
if (me.map[id]) {
return
}
This prevents the crash but masks the underlying issue.
Root Cause Investigation Needed:
We need to determine why createInstance is being invoked multiple times.
- Hypothesis 1: The
processCachedMethodCalls mechanism in Neo.main.addon.Base might be replaying a call that was also executed live (race condition).
- Hypothesis 2: The wrapper component (
src/component/wrapper/MonacoEditor.mjs) might be sending the message twice (e.g., afterSetMounted triggering multiple times).
- Hypothesis 3: The new
windowId routing logic might be delivering the same message twice (unlikely but possible).
This ticket tracks the regression fix and the subsequent investigation.
Symptom: After the recent architecture changes (#8149), the Monaco Editor wrapper started throwing:
Error: Element already has context attribute: neo-monaco-editor...This indicatesmonaco.editor.create(node, ...)is being called twice on the same DOM element.Immediate Fix: Made
Neo.main.addon.MonacoEditor.createInstanceidempotent by adding a check:if (me.map[id]) { return }This prevents the crash but masks the underlying issue.
Root Cause Investigation Needed: We need to determine why
createInstanceis being invoked multiple times.processCachedMethodCallsmechanism inNeo.main.addon.Basemight be replaying a call that was also executed live (race condition).src/component/wrapper/MonacoEditor.mjs) might be sending the message twice (e.g.,afterSetMountedtriggering multiple times).windowIdrouting logic might be delivering the same message twice (unlikely but possible).This ticket tracks the regression fix and the subsequent investigation.