Skip to content

Fix: Use correct method to uninstall plugins during rollback#189

Merged
taylortom merged 1 commit intomasterfrom
fix/rollback-uninstall-plugin
Mar 24, 2026
Merged

Fix: Use correct method to uninstall plugins during rollback#189
taylortom merged 1 commit intomasterfrom
fix/rollback-uninstall-plugin

Conversation

@taylortom
Copy link
Copy Markdown
Contributor

@taylortom taylortom commented Mar 24, 2026

Fix

  • Rollback called this.contentplugin.uninstallPlugin() which does not exist on ContentPluginModule — the correct method is delete({ _id }). This caused a TypeError that masked the original import error and prevented cleanup of newly installed plugins on failed imports.
  • Updated unit tests that were mocking the non-existent uninstallPlugin method, which hid the bug from test coverage.
  • installFramework and updateFramework passed a semver range (>=5.0.0 <6.0.0) directly to the CLI as a version tag. The CLI used this as a GitHub archive branch name, producing a 404. Now resolves the range to a concrete version via getLatestVersion() first.
  • Fixed typo: getLatestFrameworkVersion param should be versionLimit not version (refs Update: Allow versionLimit to be passed to getLatestFrameworkVersion (fixes #240) adaptlearning/adapt-cli#241).

Testing

  • Unit tests updated and passing
  • npx standard passes
  • Integration import tests pass (including re-import and dry-run)

The rollback called `this.contentplugin.uninstallPlugin()` which does
not exist on ContentPluginModule. The correct method is `delete()`.
This caused a TypeError that masked the original import error and
prevented proper cleanup of newly installed plugins.
@taylortom taylortom merged commit cf5520b into master Mar 24, 2026
2 checks passed
@taylortom taylortom deleted the fix/rollback-uninstall-plugin branch March 24, 2026 22:45
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant