Repository navigation
fix: do not initialize old dprint-plugin-gofumpt versions twice - #1308
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The compilation fallback needs automated integration coverage for the reported regression and rejection paths.
1 open finding
What changed in this PR
Adds compatibility for gofumpt versions before 0.0.19 that initialize themselves during Wasm startup.
Changes:
- Skips duplicate
_initializecalls for affected versions. - Retries first-time compilation to discover plugin identity.
- Adds unit coverage for initialization skipping and version detection.
| File | Description |
|---|---|
plugin.rs |
Applies compatibility behavior to cached plugins. |
load_instance.rs |
Adds initialization controls and unit tests. |
compile.rs |
Adds first-compilation fallback logic. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| }; | ||
|
|
||
| // load the plugin and get the info | ||
| let plugin_info = match get_plugin_info(&module) { |
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #1306
dprint 0.61.0 started calling
_initializeon Wasm plugins that export it (#1303), per the WASI reactor convention. dprint-plugin-gofumpt before 0.0.19 runs_initializeas its Wasm start function while still exporting it, so it got initialized twice and trapped withunreachable.This hardcodes an exception: plugins named
dprint-plugin-gofumptwith a version below 0.0.19 no longer get the host_initializecall._initialize, it retries once without calling it and accepts the result only when the plugin turns out to be an old gofumpt. Otherwise the original error is returned.Tested manually against the real gofumpt 0.0.18 and 0.0.19 plugins with a fresh cache (first compile and cached load).