Skip to content

Commit

Permalink
fix(core): Unload any existing version of a community nodes package b…
Browse files Browse the repository at this point in the history
…efore upgrading it (#11727)
  • Loading branch information
netroy authored Nov 19, 2024
1 parent 17ef2c6 commit 1d8fd13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ describe('CommunityPackagesService', () => {
expect.any(Object),
expect.any(Function),
);
expect(loadNodesAndCredentials.unloadPackage).toHaveBeenCalledWith(
installedPackage.packageName,
);
expect(loadNodesAndCredentials.loadPackage).toHaveBeenCalledWith(
installedPackage.packageName,
);
});

test('should throw when not licensed', async () => {
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/services/community-packages.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ export class CommunityPackagesService {

let loader: PackageDirectoryLoader;
try {
await this.loadNodesAndCredentials.unloadPackage(packageName);
loader = await this.loadNodesAndCredentials.loadPackage(packageName);
} catch (error) {
// Remove this package since loading it failed
Expand Down

0 comments on commit 1d8fd13

Please sign in to comment.