Skip to content

Fixes line series gaps#2113

Merged
beto-rodriguez merged 4 commits intodevfrom
vector-fixes
Mar 16, 2026
Merged

Fixes line series gaps#2113
beto-rodriguez merged 4 commits intodevfrom
vector-fixes

Conversation

@beto-rodriguez
Copy link
Collaborator

Copilot AI review requested due to automatic review settings March 7, 2026 15:33
@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Thanks for your contribution! 🤗 (1 / 4)

The build and test process is starting. This may take a while.
You can find more details below as the process continues or at the actions tab.

Packing complete! 📦 (2 / 4)

You can download the NuGet packages for this build here.
The packages will be available for 30 days, you can either use them directly, or wait for this PR to be merged to have them published to NuGet.org.

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)

@beto-rodriguez beto-rodriguez changed the title add test for #1996 and #2083 Fixes line series gaps Mar 7, 2026
@beto-rodriguez beto-rodriguez marked this pull request as draft March 7, 2026 15:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 an ObservableCollection<int?> with null insertions 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.

Comment on lines +107 to +118
_ = chart.GetImage();

var count = 0;
int?[] toAdd = [null, 1];

void Push()
{
points.Add(toAdd[count++ % toAdd.Length]);
points.RemoveAt(0);

_ = chart.GetImage();
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Thanks for your contribution! 🤗 (1 / 4)

The build and test process is starting. This may take a while.
You can find more details below as the process continues or at the actions tab.

Packing complete! 📦 (2 / 4)

You can download the NuGet packages for this build here.
The packages will be available for 30 days, you can either use them directly, or wait for this PR to be merged to have them published to NuGet.org.

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)

@github-actions
Copy link

github-actions bot commented Mar 16, 2026

Thanks for your contribution! 🤗 (1 / 4)

The build and test process is starting. This may take a while.
You can find more details below as the process continues or at the actions tab.

Packing complete! 📦 (2 / 4)

You can download the NuGet packages for this build here.
The packages will be available for 30 days, you can either use them directly, or wait for this PR to be merged to have them published to NuGet.org.

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)

@beto-rodriguez beto-rodriguez marked this pull request as ready for review March 16, 2026 20:11
Copilot AI review requested due to automatic review settings March 16, 2026 20:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings March 16, 2026 20:16
@github-actions
Copy link

github-actions bot commented Mar 16, 2026

Thanks for your contribution! 🤗 (1 / 4)

The build and test process is starting. This may take a while.
You can find more details below as the process continues or at the actions tab.

Packing complete! 📦 (2 / 4)

You can download the NuGet packages for this build here.
The packages will be available for 30 days, you can either use them directly, or wait for this PR to be merged to have them published to NuGet.org.

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)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 23 to 35
@@ -35,6 +33,13 @@ public void AddConsecutiveSegment(Segment segment, bool followsPrevious)
LinkedListNode<Segment>? replaceCandidate = null;
List<LinkedListNode<Segment>>? deleteCandidates = null;

@beto-rodriguez beto-rodriguez merged commit 9846312 into dev Mar 16, 2026
41 of 42 checks passed
@beto-rodriguez beto-rodriguez deleted the vector-fixes branch March 18, 2026 13:00
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.

2 participants