Issue 905: IndexOutOfRangeException bringing up GraphFullScan immediately after modifying the document

issues
Status:open
Assigned To:Rita Chupalov
Type:Defect
Area:Skyline
Priority:3
Milestone:23.1
Opened:2022-09-17 by Nick Shulman
Changed:2022-09-17 by Nick Shulman
Resolved:
Resolution:
Closed:
2022-09-17 Nick Shulman
Title»IndexOutOfRangeException bringing up GraphFullScan immediately after modifying the document
Assigned To»Rita Chupalov
Type»Defect
Area»Skyline
Priority»3
Milestone»23.1
If the user manages to click a chromatogram curve immediately after adjusting peak boundaries, there can be an IndexOutOfRangeException in GraphFullScan.CreateSingleScan

I was able to get this to happen using the document and raw files in:
/net/maccoss/vol6/home/nicksh/bugs/CreateSingleScan
I would click and drag below the X-axis to adjust peak boundaries, and then immediately move the mouse a bit and click on one of the chromatogram curves to bring up the full scan viewer.

The IndexOutOfRangeException happens on the line of code:
            var currentTransition =
                _msDataFileScanHelper.ScanProvider.Transitions[_msDataFileScanHelper.TransitionIndex];

The problem is that "Transitions" is an empty list, and the reason that it's an empty array is that "_scanProvider" is null, and the getter for the "Transitions" property returns an empty array if _scanProvider is null.

When the document changes as a result of the peak boundary change, "_scanProvider" gets set to null by GraphFullScan.OnDocumentUIChanged.

I am not sure what the correct fix should be. I don't think the class "BackgroundScanProvider" has a clear idea of what states it should transition between when things change.