Conversation
beto-rodriguez
commented
Mar 7, 2026
- fixes "This should not happen :(" #1996
- fixes Toggle visibility of XamlLineSeries from False to True causes crash under specific circumenstance #2083
Thanks for your contribution! 🤗 (1 / 4)The build and test process is starting. This may take a while. Packing complete! 📦 (2 / 4)You can download the NuGet packages for this build here. Running tests 🧪 (3 / 4)Tests are running now, you can monitor their progress below or at the actions tab. Core ✅ | Snapshot ❌ | Windows ✅ | Linux ✅ | Mac ✅ | Browser ✅ | Android ✅ | iOS ✅ Test Results Summary (Failure) ❌ (4 / 4) |
There was a problem hiding this comment.
Pull request overview
Adds a regression snapshot test to cover line series behavior when values contain gaps (null) while the bound collection is mutated (add + remove), targeting crashes reported in #1996 and #2083.
Changes:
- Add
LineSeriesTests.Gaps()snapshot test using anObservableCollection<int?>withnullinsertions and removals. - Add the corresponding baseline snapshot image for the new test.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/SnapshotTests/LineSeriesTests.cs | Adds a new snapshot test that mutates a nullable-values collection to exercise “gaps” scenarios. |
| tests/SnapshotTests/Snapshots/LineSeriesTests_Gaps.png | Adds the expected snapshot output for the new Gaps test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| _ = chart.GetImage(); | ||
|
|
||
| var count = 0; | ||
| int?[] toAdd = [null, 1]; | ||
|
|
||
| void Push() | ||
| { | ||
| points.Add(toAdd[count++ % toAdd.Length]); | ||
| points.RemoveAt(0); | ||
|
|
||
| _ = chart.GetImage(); | ||
| } |
There was a problem hiding this comment.
SKCartesianChart.GetImage() returns an SKImage that holds unmanaged resources and should be disposed. These calls discard the returned image without disposing it, which can leak native memory during the test run. Consider disposing the returned image (or switching to SaveImage, which already disposes internally) for the warm-up render and for each Push() render.
Thanks for your contribution! 🤗 (1 / 4)The build and test process is starting. This may take a while. Packing complete! 📦 (2 / 4)You can download the NuGet packages for this build here. Running tests 🧪 (3 / 4)Tests are running now, you can monitor their progress below or at the actions tab. Core ✅ | Snapshot ❌ | Windows ❌ | Linux ✅ | Mac ✅ | Browser ✅ | Android ✅ | iOS ✅ Test Results Summary (Failure) ❌ (4 / 4) |
Thanks for your contribution! 🤗 (1 / 4)The build and test process is starting. This may take a while. Packing complete! 📦 (2 / 4)You can download the NuGet packages for this build here. Running tests 🧪 (3 / 4)Tests are running now, you can monitor their progress below or at the actions tab. Core ✅ | Snapshot ✅ | Windows ✅ | Linux ✅ | Mac ✅ | Browser ✅ | Android ✅ | iOS ✅ Test Results Summary (Passed) ✅ (4 / 4) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 12 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Thanks for your contribution! 🤗 (1 / 4)The build and test process is starting. This may take a while. Packing complete! 📦 (2 / 4)You can download the NuGet packages for this build here. Running tests 🧪 (3 / 4)Tests are running now, you can monitor their progress below or at the actions tab. Core ✅ | Snapshot ✅ | Windows ✅ | Linux ✅ | Mac ✅ | Browser ✅ | Android ✅ | iOS ❌ Test Results Summary (Failure) ❌ (4 / 4) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 12 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| @@ -35,6 +33,13 @@ public void AddConsecutiveSegment(Segment segment, bool followsPrevious) | |||
| LinkedListNode<Segment>? replaceCandidate = null; | |||
| List<LinkedListNode<Segment>>? deleteCandidates = null; | |||
|
|
|||