Skip to content

Conversation

@jacdavis
Copy link
Contributor

@jacdavis jacdavis commented Feb 5, 2024

Add unit test to confirm change token is disposed during razer hot reload.

During the unit test, the disposable change token is wrapped in an object that can
track and return dispose state. This is only used during this one unit test.

@jacdavis jacdavis requested a review from a team as a code owner February 5, 2024 23:16
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Feb 5, 2024
to create the wrapped disposable for this unit test.
@jacdavis jacdavis enabled auto-merge (squash) February 7, 2024 18:26
@jacdavis jacdavis merged commit 06bb2b9 into main Feb 9, 2024
@jacdavis jacdavis deleted the jacdavisHotReloadDisposeTest branch February 9, 2024 18:55
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-preview2 milestone Feb 9, 2024
MackinnonBuck added a commit that referenced this pull request Feb 9, 2024
* Add unit test to confirm change token is disposed during
razer hot reload.

* Per Makinnon's feedback, switch to a callback model
to create the wrapped disposable for this unit test.

* Update src/Components/Endpoints/test/HotReloadServiceTests.cs

---------

Co-authored-by: Mackinnon Buck <[email protected]>
wtgodbe pushed a commit that referenced this pull request Feb 12, 2024
* Resolve change token leak in Blazor hot reload (#53750)

Fix of razor hotreload change token leak. This disposes the
old change tokens after the ClearCache event or before overwriting. 
If something goes wrong and this isn't cleared
before the next invocation of UpdateEndpoints on the
razor data source, clear it and dispose of it then.

* Add unit test to confirm change token is disposed during (#53827)

* Add unit test to confirm change token is disposed during
razer hot reload.

* Per Makinnon's feedback, switch to a callback model
to create the wrapped disposable for this unit test.

* Update src/Components/Endpoints/test/HotReloadServiceTests.cs

---------

Co-authored-by: Mackinnon Buck <[email protected]>

---------

Co-authored-by: jacdavis <[email protected]>
onurmicoogullari pushed a commit to onurmicoogullari/aspnetcore that referenced this pull request Feb 14, 2024
* Add unit test to confirm change token is disposed during
razer hot reload.

* Per Makinnon's feedback, switch to a callback model
to create the wrapped disposable for this unit test.

* Update src/Components/Endpoints/test/HotReloadServiceTests.cs

---------

Co-authored-by: Mackinnon Buck <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants