fix(rune): address conductor migration nitpicks - #835
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
| throw new GeneralRuntimeError('Rune channel is required but was not provided.'); | ||
| } | ||
|
|
||
| super(conduit, [runeChannel], evaluator); |
There was a problem hiding this comment.
Are there instances where an error is encountered without this change?
There was a problem hiding this comment.
No observed user-facing runtime failure from this constructor ordering specifically. This one is a defensive/parity fix from the linked issue: with the old order, super(conduit, [runeChannel], evaluator) receives [undefined] before Rune gets a chance to throw its own "Rune channel is required" error. Moving the guard before super() keeps the invalid channel out of BaseModulePlugin entirely.
|
|
||
| override async initialise() { | ||
| if (this.__initialised) return; | ||
| this.__initialised = true; |
There was a problem hiding this comment.
Same here, I'd love to hear the motivation behind this PR! Do you have a code sample out of curiosity?
There was a problem hiding this comment.
Ah, I just noticed the attached issue, let me get home and review this
There was a problem hiding this comment.
Quick concrete repro for the initialise() part: create a RuneModulePlugin, call await plugin.initialise(), then call it again. Before this change, the second call re-runs super.initialise() and re-pushes the exported methods/primitive runes, so plugin.exports.map(each => each.symbol) grows duplicates. The added initialise only exports primitive runes once test pins that behavior. The tab lookup part is similarly low-risk cleanup: createRunePlugin(["Other Tab", RUNE_TAB_NAME]) should load RUNE_TAB_NAME, not whatever happens to be at tabs[0].
Summary
Tests
Not run locally
Addresses #827