Skip to content

DYN-9151: Show trust warning popup before Open/Insert command execution#17104

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/dyn-9151-fix-warning-popup-delay
Draft

DYN-9151: Show trust warning popup before Open/Insert command execution#17104
Copilot wants to merge 3 commits into
masterfrom
copilot/dyn-9151-fix-warning-popup-delay

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Opening a .dyn from an untrusted location showed the trust popup only after synchronous graph load completed, which made the warning appear delayed on large graphs. This change moves popup activation ahead of heavy open/insert work and reconciles state after load.

  • Behavioral fix: pre-load popup activation in DynamoViewModel.Open and Insert

    • Computes displayTrustWarning as before (including .dyf exclusion).
    • Sets FileTrustViewModel popup state before executing OpenFileCommand / InsertFileCommand.
    • Preserves run blocking via RunSettings.ForceBlockRun.
  • Post-load reconciliation

    • Calls ShowHideFileTrustWarningIfCurrentWorkspaceTrusted() after command execution (only when warning was pre-shown) to resolve cases where trust state changed during load (e.g., location became trusted or warnings disabled).
  • Failure-path cleanup

    • Adds ResetTrustWarningStateIfNeeded(...) to clear popup/block-run state if open/insert throws after pre-showing the warning.
  • Regression coverage

    • Adds command-order tests in DynamoViewTests:
      • WhenOpeningWorkspaceThenTrustWarningIsShownBeforeCommand
      • WhenInsertingWorkspaceThenTrustWarningIsShownBeforeCommand
    • Both assert popup state is already true at command start (Model.CommandStarting) for the corresponding command type.
if (displayTrustWarning)
{
    FileTrustViewModel.AllowOneTimeTrust = false;
    FileTrustViewModel.DynFileDirectoryName = directoryName;
    FileTrustViewModel.ShowWarningPopup = true;
    (HomeSpaceViewModel as HomeWorkspaceViewModel)?.UpdateRunStatusMsgBasedOnStates();
    trustWarningWasShown = true;
}

ExecuteCommand(new DynamoModel.OpenFileCommand(filePath, forceManualMode, isTemplate));

if (trustWarningWasShown)
{
    ShowHideFileTrustWarningIfCurrentWorkspaceTrusted();
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • npm.autodesk.com
    • Triggering command: /usr/bin/pwsh pwsh -ExecutionPolicy Bypass -File /home/REDACTED/work/Dynamo/Dynamo/src/setnpmreg.ps1 (dns block)
    • Triggering command: /usr/bin/pwsh pwsh -ExecutionPolicy ByPass -Command & '/home/REDACTED/work/Dynamo/Dynamo/src/setnpmreg.ps1' (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits May 12, 2026 18:18
Agent-Logs-Url: https://github.com/DynamoDS/Dynamo/sessions/6a0b0707-437a-4932-99a5-642be0cb85b4

Co-authored-by: johnpierson <15744724+johnpierson@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix trust warning popup delay for large graph opening DYN-9151: Show trust warning popup before Open/Insert command execution May 12, 2026
Copilot AI requested a review from johnpierson May 12, 2026 18:22
var insertMethod = typeof(DynamoViewModel).GetMethod("Insert", BindingFlags.NonPublic | BindingFlags.Instance);
Assert.NotNull(insertMethod);

var insertPath = Path.Combine(GetTestDirectory(ExecutingDirectory), @"core\CustomNodes\TestAdd.dyn");
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DYN-9151: Trust warning popup delayed by 20+ seconds on large graph open from untrusted folder

2 participants