Skip to content

[BUG] Robot Advice Copy to Clipboard can crash app when clipboard is unavailable #415

Description

@SalmanRajwani

Component

Desktop App (Windows)

SQL Performance Studio Version

1.19.0

Operating System

Windows 11

Describe the Bug

Clicking Copy to Clipboard in the Robot Advice window can crash the app when the Windows clipboard is temporarily unavailable/busy.

This appears to be an unhandled async clipboard exception in the Robot Advice copy handler. The plan-analysis pipeline itself completed successfully locally, and the Robot Advice window/content also built and rendered successfully. The failure evidence points specifically to the clipboard write path.

Steps to Reproduce

  1. Open a valid execution plan.
  2. Open Robot Advice.
  3. Click Copy to Clipboard while the Windows clipboard is unavailable or busy.

Expected Behavior

The app should not terminate. Clipboard failures should be caught and surfaced as a non-fatal UI message, for example: "Clipboard is busy, try again."

Actual Behavior

The app can terminate with a Windows APPCRASH.

Observed Windows crash details:

Faulting application name: PlanViewer.App.exe
Faulting application version: 1.19.0.0
Faulting module name: KERNELBASE.dll
Exception code: 0xe0434352

Managed exception stack captured locally:

System.Runtime.InteropServices.COMException: OpenClipboard Failed (0x800401D0 (CLIPBRD_E_CANT_OPEN))
   at Avalonia.Win32.ClipboardImpl.SetDataAsync(IAsyncDataTransfer dataTransfer)
   at PlanViewer.App.Services.AdviceWindowHelper.<>c__DisplayClass0_0.<<Show>b__2>d.MoveNext()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_0(Object state)
   at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore()

Plan File

Not attached. The issue does not appear to be plan-specific, and I do not want to share query text or schema details publicly.

Additional Context

I checked for existing issues mentioning OpenClipboard, CLIPBRD_E_CANT_OPEN, and Robot Advice clipboard crashes and did not find a duplicate. The closest historical issue I found was #81, but that was for Robot/Human Advice windows not opening and Copy Repro Script behavior in 1.1.0, and it is closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions