DynamoDS/DYN-8973: [SPIKE] Investigate why there is arbitrary network traffic even during Dynamo startup with no-network mode set to true#17158
Closed
edwin-vasquez-ucaldas wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8973
Adds doc/no-network-mode-traffic-baseline.md with the reproduction procedure, expected first-party endpoints (derived from App.config files and code inspection), and the WebView2 / OS-level surfaces that are out of Dynamo's first-party control. Empirical capture tables are left as TODO sections to be filled in from a manual Wireshark / Process Monitor run on a clean Windows VM.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes https://autodesk.atlassian.net/browse/DYN-8973
h1. Audit and Tighten {{--NoNetworkMode}} Startup Traffic Implementation Plan
h2. Overview
This spike asks why network traffic still appears during Dynamo startup when {{--NoNetworkMode}} is on. Investigation shows the flag correctly silences every Dynamo-authored HTTP/REST client. The residual traffic comes from WebView2 / Microsoft Edge runtime background services invoked when Dynamo opens its WebView2 surfaces (SplashScreen, HomePage, Library, DocumentationBrowser). None of those surfaces currently pass {{CoreWebView2EnvironmentOptions.AdditionalBrowserArguments}} to suppress Edge component update, SmartScreen, domain reliability, etc. A secondary issue is that the SplashScreen is constructed before {{NoNetworkMode}} is propagated to any view-side surface, so even a properly configured no-network WebView2 profile is bypassed for the first window the user sees.
Plan: (1) capture an empirical baseline of what fires under {{--NoNetworkMode}}; (2) thread the flag into every WebView2 initialization path; (3) configure WebView2 environment options to disable Edge background networking when the flag is set; (4) guard a small set of unconditional helpers; (5) document and lock the behavior with a regression test.
h2. Current State Analysis
h3. Key Discoveries:
h2. Desired End State
When Dynamo launches with {{--NoNetworkMode}}, a packet capture of the Dynamo process tree during "launch → idle home workspace" shows:
Verification: extend {{DynamoApplicationTests}} to launch {{DynamoCLI}} and {{DynamoWPFCLI}} with {{--NoNetworkMode}} while a global socket-creation hook fails the test on any non-loopback connection.
h2. What We're NOT Doing
h2. Implementation Approach
Sequenced as: (1) baseline measurement → (2) plumb flag to all WebView2 init sites → (3) build no-network WebView2 environment factory → (4) guard residual unconditional helpers → (5) regression test → (6) documentation. Each task ends with a single observable milestone.
h3. TASK 1: Capture an empirical baseline of all outbound traffic under {{--NoNetworkMode}} [HIGH PRIORITY]
Status: DONE
Milestone: A reproducible packet/process trace, committed as a markdown report under {{doc/}}, listing every observed remote endpoint and the process that initiated it, classified as (a) Dynamo first-party, (b) WebView2/Edge runtime, (c) OS-level (CER, IDSDK service, Edge updater).
Validation: Reviewer can rerun the procedure and reproduce the same endpoint set within tolerance.
Requirements from spec:
Files to Create:
Files to Modify:
Implementation Details:
Use {{npcap}} filter {{ip and not host 127.0.0.1}} and Wireshark display filter {{tcp.flags.syn == 1 and tcp.flags.ack == 0}}. Cross-reference with Process Monitor {{Network Activity}} view to attach PIDs.
h3. TASK 2: Add a no-network WebView2 environment factory [HIGH PRIORITY]
Status: NOT STARTED
Milestone: Every WebView2 surface in Dynamo can opt into a hardened Edge profile in one line, and a unit test verifies the configured {{AdditionalBrowserArguments}} contains the expected Edge flags.
Validation: New NUnit test {{DynamoWebView2Tests.WhenNoNetworkModeEnabledThenAdditionalBrowserArgumentsContainsDisableBackgroundNetworking}} asserts the configured command line includes the expected flags.
Requirements from spec:
Files to Modify:
Implementation Details:
Edge command-line arguments are documented in Chromium switches; WebView2 inherits the Chromium command-line surface. {{OptimizationGuideModelDownloading}} suppresses Edge ML model downloads.
h3. TASK 3: Thread {{NoNetworkMode}} into SplashScreen and pass hardened options [HIGH PRIORITY]
Status: NOT STARTED
Milestone: With {{--NoNetworkMode}} set, splash WebView2 starts with Edge background networking disabled before any frame is rendered.
Validation: Run {{DynamoSandbox.exe --NoNetworkMode}}, take a Process Monitor capture of the splash {{msedgewebview2.exe}} child, confirm zero outbound connections to {{.msedge.net}}, {{.bing.com}}, {{*.googleapis.com}}, {{dl.delivery.mp.microsoft.com}}.
Requirements from spec:
Files to Modify:
Implementation Details:
Add a second constructor overload rather than changing the default-valued single ctor — public API hygiene per {{dynamo-core-rules.md}}.
h3. TASK 4: Thread {{NoNetworkMode}} into HomePage / Library / DocumentationBrowser [HIGH PRIORITY]
Status: NOT STARTED
Milestone: Every WebView2 surface created after the model exists initializes with the hardened Edge profile when {{NoNetworkMode}} is true.
Validation: With {{--NoNetworkMode}}, only splash and home WebView2 children should be running, with zero non-local connections.
Requirements from spec:
Files to Modify:
Implementation Details:
For view extensions, prefer the {{StartupParams.NoNetworkMode}} path since it's already in the contract.
h3. TASK 5: Guard residual unconditional helpers [MEDIUM PRIORITY]
Status: NOT STARTED
Milestone: No code path allocates network plumbing when {{NoNetworkMode}} is true.
Validation: Re-run Process Monitor; confirm no {{HttpClient}} is allocated by {{NetworkUtilities}}.
Requirements from spec:
Files to Modify:
Implementation Details:
For CER, the path is {{DynamoCoreSetup.cs:110 → viewModel.Model.OnRequestsCrashPrompt → CrashReportTool.ShowCrashWindow}}. Add a guard inside {{ShowCrashWindow}} reading {{args?.Model?.NoNetworkMode}}, or expose {{NoNetworkMode}} on {{CrashErrorReportArgs}}.
h3. TASK 6: Add a regression test that fails on any unexpected outbound socket [HIGH PRIORITY]
Status: NOT STARTED
Milestone: NUnit test in {{DynamoApplicationTests.cs}} launches DynamoCLI (and DynamoWPFCLI) with {{--NoNetworkMode}} and asserts no non-loopback TCP socket is opened by the process tree during a 30-second idle window.
Validation: {{dotnet test test/System/IntegrationTests --filter Name~NoNetworkMode}} passes.
Requirements from spec:
Files to Modify:
Implementation Details:
WebView2 children appear under the same parent PID; iterate {{Process.GetProcesses()}} and filter by {{Parent.Id == cliProcess.Id}} plus a name allow-list. Use NUnit {{Assert.That(..., Is.Empty)}}. Test should run on a clean dev machine or isolated CI agent to avoid Defender/proxy noise.
h3. TASK 7: Document the contract [MEDIUM PRIORITY]
Status: NOT STARTED
Milestone: Developer-facing doc lists every gated and ungated network surface, with rationale and the WebView2 caveat made explicit.
Validation: Reviewer reads the doc and can predict what a Wireshark capture will show.
Requirements from spec:
Files to Create:
Files to Modify:
Implementation Details:
Follow the structure of existing docs in {{doc/distrib/}}. Include the endpoint inventory verbatim from research.
h2. Testing Strategy
h3. Unit Tests:
h3. Integration Tests:
** Verify analytics, feature flags, IDSDK, Greg, notifications all skip startup work.
** Verify zero outbound TCP from Dynamo process tree (Task 6).
** Verify splash and home WebView2 children inherit the hardened Edge command line ({{Process.GetCommandLine()}} of {{msedgewebview2.exe}} children).
h3. Manual Testing Steps:
{{DynamoSandbox.exe}} (no flag) + Wireshark filter {{tcp.flags.syn == 1 and not ip.dst == 127.0.0.1}}. Confirm baseline traffic.
{{DynamoSandbox.exe --NoNetworkMode}}. Confirm zero first-party and zero WebView2 platform traffic.
{{DynamoCLI.exe --NoNetworkMode -o some.dyn -k}}. Confirm zero traffic.
Click around the home page; verify no YouTube embed fires a request.
Verify "Open Package Manager" is disabled.
Trigger a deliberate crash and confirm CER does not upload, or an in-product message warns.
Run Task 6 integration test.
h2. Performance Considerations
h2. Migration Notes