Skip to content

Commit

Permalink
DYN-8268: fix noNetworkMode for PM client (#15809)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzart90 authored Feb 6, 2025
1 parent 5f77cfc commit 41d8912
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/DynamoPackages/PackageManagerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ internal PackageManagerClient(IGregClient client, IPackageUploadBuilder builder,
this.uploadBuilder = builder;
this.client = client;
this.packageMaintainers = new Dictionary<string, bool>();

this.LoadCompatibilityMap(); // Load the compatibility map
}

internal bool Upvote(string packageId)
Expand Down Expand Up @@ -370,7 +368,7 @@ internal static Dictionary<string, Dictionary<string, string>> GetCompatibilityM
/// <summary>
/// Method to load the map once, making it accessible to all elements
/// </summary>
private void LoadCompatibilityMap()
internal void LoadCompatibilityMap()
{
if (compatibilityMap == null) // Load only if not already loaded
{
Expand Down
10 changes: 9 additions & 1 deletion src/DynamoPackages/PackageManagerExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,16 @@ public void Startup(StartupParams startupParams)
new GregClient(startupParams.AuthProvider, url),
uploadBuilder, packageUploadDirectory);

LoadPackages(startupParams.Preferences, startupParams.PathManager);
noNetworkMode = startupParams.NoNetworkMode;

//we don't ask dpm for the compatibility map in offline mode.
if (!noNetworkMode)
{
// Load the compatibility map
PackageManagerClient.LoadCompatibilityMap();
}

LoadPackages(startupParams.Preferences, startupParams.PathManager);
}

/// <summary>
Expand Down

0 comments on commit 41d8912

Please sign in to comment.