Skip to content

fix: install nested plugin dependencies - #3141

Merged
bajrangCoder merged 1 commit into
Acode-Foundation:mainfrom
divya0795:fix/plugin-nested-dependencies
Dec 2, 2026
Merged

bajrangCoder merged 1 commit into
Acode-Foundation:mainfrom
divya0795:fix/plugin-nested-dependencies

Conversation

@divya0795

Copy link
Copy Markdown
Contributor

Bug

A plugin can't be installed if one of its dependencies declares dependencies of its own.

resolveDepsManifest (src/lib/installPlugin.js) resolves dependencies recursively, but pushes the recursive call's result without spreading it:

if (remoteDependency.dependencies) {
	const manifests = await resolveDepsManifest(remoteDependency.dependencies);
	resolved.push(manifests); // pushes an array into the flat list
}

For plugin A → dependency B → dependency C, the list becomes [[C], B]. Then:

  • the confirm dialog joins value.name, so the first entry is blank: "…dependencies:<br /><br />, B"
  • resolveDep([C]) reads manifest.id → undefined, so installPlugin downloads …/plugin/download/undefined?…. That fails, and the outer catch deletes the half-installed plugin and rethrows.

This also happens when C is already installed and up to date. The recursive call then returns an empty array, which is still pushed. So any dependency that declares dependencies breaks the install of every plugin that depends on it.

Fix

-			resolved.push(manifests);
+			resolved.push(...manifests);

Tests

New tests/unit/installPluginDependencies.test.js runs the real installPlugin.js through loadSourceModule, using the same fixture style as iosPluginInstall.test.js. It has 2 cases: A → B → C, and A → B → C with C already installed at the same version. It checks the dialog text, the download order and the load order. Both fail on main:

× installs a dependency that has its own dependency
× installs a dependency whose own dependency is already up to date
Error: 404 https://fixture.invalid/plugin/download/undefined?device=fixture&package=com.foxdebug.acode&version=18.6
Tests  2 failed (2)

With the fix both pass. The dialog reads "Nested, Direct" (or "Direct" when C is current), the installs run C → B → A, and nothing requests undefined.

Local gate (macOS, Node 24): npx vitest run 1207 passed / 1 skipped (1205 + 2 new on main), npm run typecheck clean, biome ci . clean, typos clean on the changed files. Not tested on a device.

🤖 Generated with Claude Code

resolveDepsManifest pushed the array returned by its recursive call
without spreading it. When a dependency declares its own dependencies,
the confirm dialog showed a blank name and resolveDep received an
array, so installPlugin downloaded plugin id "undefined" and the whole
install was rolled back. This also happened when the nested dependency
was already installed, because the empty array was still pushed.

Spread the nested manifests into the flat list.
@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Fixes nested plugin installs by adding each recursive result to the dependency list instead of adding the array itself.

  • Plugin installs keep nested dependencies in one flat list.

Reviews (1) · Last reviewed commit: "fix: install nested plugin dependencies" · Reviewed by Greptile

@bajrangCoder
bajrangCoder added this pull request to the merge queue Dec 2, 2026
Merged via the queue into Acode-Foundation:main with commit 3966a59 Dec 2, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Dec 2, 2026
@UnschooledGamer UnschooledGamer moved this from Done to 🫡 Done by Community in The Code Board - Acode Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🫡 Done by Community

Development

Successfully merging this pull request may close these issues.

3 participants