Skip to content

Remove unused _sourceShapes field from DrawingManager#121

Merged
arnaudleclerc merged 2 commits intoreleases/1.18.0from
copilot/sub-pr-119
Mar 10, 2026
Merged

Remove unused _sourceShapes field from DrawingManager#121
arnaudleclerc merged 2 commits intoreleases/1.18.0from
copilot/sub-pr-119

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

_sourceShapes in DrawingManager was only ever appended to and reset to null — never read or queried — causing unbounded memory growth proportional to the number of shapes added.

Changes

  • DrawingManager.cs: Remove _sourceShapes field, its lazy initialization in AddShapesAsync, the AddRange call, and the null reset in ClearAsync
  • DrawingManagerTests.cs: Remove reflection-based internal state assertions and the GetInternalSourceShapes helper; affected tests now solely verify JS runtime calls

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…y overhead

Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback from review on Releases/1.18.0 PR Remove unused _sourceShapes field from DrawingManager Mar 10, 2026
@arnaudleclerc arnaudleclerc marked this pull request as ready for review March 10, 2026 17:33
@arnaudleclerc arnaudleclerc merged commit 119b2c3 into releases/1.18.0 Mar 10, 2026
arnaudleclerc added a commit that referenced this pull request Mar 10, 2026
* Add ability to add and remove shapes from drawing manager data source (#110)

* Add Drawing Manager component that can be used to add or remove shapes from drawing manager datasource

* Add sample page for adding and removing shapes.

* Add tests for  DrawingManager.

* Upgrade projects to supported .NET versions (net8.0, net9.0, net10.0) (#115)

- Drop net6.0 (EOL Nov 2024) and net7.0 (EOL May 2024)
- Add net9.0 and net10.0 target frameworks to library and test projects
- Update sample project to target net10.0
- Add per-TFM package references for net9.0 and net10.0
- Upgrade bunit from 1.26.64 to 1.37.7 for .NET 9/10 compatibility
- Update all CI workflows to set up .NET 8.0, 9.0, and 10.0 SDKs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Enable NuGet publish step in release workflow (#116)

Re-enable the commented-out dotnet nuget push step in release.yml.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Trigger release workflow on changes to itself (#117)

Add .github/workflows/release.yml to the paths filter so the workflow
also runs when the release workflow file itself is modified.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix missing static web assets in NuGet package (#118)

The Razor SDK generates the static web assets manifest at dotnet build
time. Previously, npm run build (which outputs the JS files to wwwroot/)
ran after dotnet build, so the manifest was generated with an empty
wwwroot/ and dotnet pack --no-build reused that stale manifest.

Fix by moving the npm install/lint/build steps before dotnet restore and
dotnet build, ensuring the compiled JS files exist in wwwroot/ when the
static web assets manifest is generated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove unused `_sourceShapes` field from `DrawingManager` (#121)

* Initial plan

* Remove unused _sourceShapes field from DrawingManager to reduce memory overhead

Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com>

---------

Co-authored-by: mtech-rherpio <166818039+mtech-rherpio@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: arnaudleclerc <9578038+arnaudleclerc@users.noreply.github.com>
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