fix(core): Unload any existing version of a community node before upgrading it

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-11-13 19:18:36 +01:00
parent a91abeeff5
commit 6fdb479775
No known key found for this signature in database
2 changed files with 7 additions and 0 deletions

View file

@ -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 () => {

View file

@ -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