Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.19.1 disable network traffic #14393

Merged
merged 8 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/DynamoApplications/StartupUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ private static DynamoModel StartDynamoWithDefaultConfig(bool CLImode,
IsServiceMode = isServiceMode,
Preferences = PreferenceSettings.Instance
};
config.AuthProvider = CLImode ? null : new Core.IDSDKManager();
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
config.UpdateManager = CLImode ? null : InitializeUpdateManager();
config.StartInTestMode = CLImode;
config.PathResolver = CLImode ? new CLIPathResolver(preloaderLocation, userDataFolder, commonDataFolder) as IPathResolver : new SandboxPathResolver(preloaderLocation) as IPathResolver;

var model = DynamoModel.Start(config);
return model;
Expand Down
6 changes: 6 additions & 0 deletions src/DynamoCore/Logging/AnalyticsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ internal static bool IsADPOptedIn

internal static bool IsADPAvailable()
{
if (Analytics.DisableAnalytics ||
adpAnalyticsUI == null)
{
return false;
}

return adpAnalyticsUI.IsProviderAvailable();
}

Expand Down
3 changes: 3 additions & 0 deletions src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,9 @@ private void CheckFeatureFlagTest()
{
if (!DynamoModel.IsTestMode)
{
if (DynamoModel.FeatureFlags == null)
return;

if (DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("EasterEggIcon1", false))
{
this.Logger.Log("EasterEggIcon1 is true FROM MODEL");
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCore/Scheduler/UpdateRenderPackageAsyncTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private void GetTessellationDataFromGraphicItem(Guid outputPortId, IGraphicItem
var previousMeshVertexCount = package.MeshVertexCount;

//Todo Plane tessellation needs to be handled here vs in LibG currently
bool instancingEnabled = DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("graphics-primitive-instancing", false);
bool instancingEnabled = DynamoModel.FeatureFlags?.CheckFeatureFlag<bool>("graphics-primitive-instancing", false) ?? false;
if (graphicItem is Plane plane)
{
CreatePlaneTessellation(package, plane);
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ public bool NodeAutocompleteMachineLearningIsBeta
{
get
{
return DynamoModel.FeatureFlags.CheckFeatureFlag("NodeAutocompleteMachineLearningIsBeta", false);
return DynamoModel.FeatureFlags?.CheckFeatureFlag("NodeAutocompleteMachineLearningIsBeta", false) ?? false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@ internal virtual void AggregateRenderPackages(IEnumerable<HelixRenderPackage> pa
//If we have any line geometry that was not associated with an instance,
//remove the previously added line data from the render package so the remaining lines can be added to the scene.
if (rp.LineVertexRangesAssociatedWithInstancing.Any()
&& DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("graphics-primitive-instancing", false))
&& DynamoModel.FeatureFlags?.CheckFeatureFlag<bool>("graphics-primitive-instancing", false) == true)
{
//For each range of line vertices add the line data and instances to the scene
var j = 0;
Expand Down Expand Up @@ -1946,7 +1946,7 @@ internal virtual void AggregateRenderPackages(IEnumerable<HelixRenderPackage> pa
//If we have any mesh geometry that was not associated with an instance, remove the previously added
//mesh data from the render package so the remaining mesh can be added to the scene.
if (rp.MeshVertexRangesAssociatedWithInstancing.Any()
&& DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("graphics-primitive-instancing", false))
&& DynamoModel.FeatureFlags?.CheckFeatureFlag<bool>("graphics-primitive-instancing", false) == true)
{
//For each range of mesh vertices add the mesh data and instances to the scene
var j = 0;
Expand Down
3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,9 @@ private void CheckTestFlags()
{
if (!DynamoModel.IsTestMode)
{
if (DynamoModel.FeatureFlags == null)
return;

//feature flag test.
if (DynamoModel.FeatureFlags?.CheckFeatureFlag<bool>("EasterEggIcon1", false) == true)
{
Expand Down
5 changes: 4 additions & 1 deletion src/DynamoPackagesWPF/PackageManagerViewExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ private void RequestLoadViewExtensionsForLoadedPackages(IEnumerable<Package> pac

private void RaisePackageHostNotifications(IEnumerable<Package> packages)
{
// ALIAS does needs a total network traffic blackout.
// Since there is no way to switch this on/off, we will just skip it for now.
/*
foreach (var pkg in packages)
{
//check that the package does not target another host, if it does raise a warning.
Expand All @@ -157,7 +160,7 @@ private void RaisePackageHostNotifications(IEnumerable<Package> packages)
Resources.TitlePackageTargetOtherHost));
}
}

*/
}

private void RequestLoadLayoutSpecs(IEnumerable<Package> packages)
Expand Down
7 changes: 5 additions & 2 deletions test/DynamoCoreWpfTests/PackageManagerViewExtensionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ public void PackageManagerViewExtesion_TriesToLoadLayoutSpecForBuiltInPackages()
Assert.AreEqual(Path.Combine(BuiltinPackagesTestDir,"SignedPackage2","extra","layoutspecs.json"), packageManagerViewExtension.RequestedLayoutSpecPaths.FirstOrDefault());
}

[Test]
// Fails because we are now forcefully disabling host checking because of ALIAS issues.
[Test, Category("Failure")]
public void PackageManagerViewExtesion_SendsNotificationForPackagesThatTargetDifferentHost_AtExtensionLoad()
{
var count = 0;
Expand Down Expand Up @@ -271,7 +272,9 @@ void PackageManagerViewExtensionTests_NotificationLogged(NotificationMessage obj
count = count + 1;
}
}
[Test]

// Fails because we are now forcefully disabling host checking because of ALIAS issues.
[Test, Category("Failure")]
public void PackageManagerViewExtesion_SendsNotificationForPackagesThatTargetDifferentHost_AtLatePackageLoad()
{
var count = 0;
Expand Down