-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Blazor] Invoke inbound activity handlers on circuit initialization #57557
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javiercn
approved these changes
Aug 28, 2024
halter73
approved these changes
Aug 29, 2024
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
This was referenced Aug 30, 2024
/backport to release/9.0 |
Started backporting to release/9.0: https://github.com/dotnet/aspnetcore/actions/runs/10688768934 |
10 tasks
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/aspnetcore/actions/runs/10724988901 |
10 tasks
mkArtakMSFT
pushed a commit
that referenced
this pull request
Sep 5, 2024
…itialization (#57678) Backport of #57557 to release/9.0 # [Blazor] Invoke inbound activity handlers on circuit initialization Fixes an issue where inbound activity handlers don't get invoked on circuit initialization. > [!NOTE] > This bug only affects Blazor Server apps, _not_ Blazor Web apps utilizing server interactivity ## Description Inbound activity handlers were added in .NET 8 to enable: * Monitoring inbound circuit activity * Enabling server-side Blazor services to be [accessed from a different DI scope](https://learn.microsoft.com/aspnet/core/blazor/fundamentals/dependency-injection?view=aspnetcore-8.0#access-server-side-blazor-services-from-a-different-di-scope) However, prior to the fix in this PR, this feature didn't apply to the first interactive render after the initial page load. This means that when utilizing this feature to access Blazor services from a different DI scope, the service might only become accessible after subsequent renders, not the initial render. This PR makes the following changes: * Updated `CircuitHost` to invoke inbound activity handlers on circuit initialization * Added an extra test to verify that inbound activity handlers work on the initial page load * Updated existing Blazor Web tests to reuse test logic from the non-web tests * This helps to ensure that the feature works the same way on Blazor Server and Blazor Web Fixes #57481 ## Customer Impact The [initial issue report](#57481) was from a customer who was impacted experiencing this problem in their app. The problem does not inherently cause an app to stop working, but if the application code has made the (rightful) assumption that the service accessor is initialized, then session may crash. The workaround is to upgrade the app to use the "Blazor Web App" pattern, although this can be a fairly large change. ## Regression? - [ ] Yes - [X] No The problem has existed since the introduction of the feature in .NET 8. ## Risk - [ ] High - [ ] Medium - [X] Low The change is straightforward, and new tests have been added to ensure that it addresses the issue. Existing tests verify that a new regression is not introduced. ## Verification - [X] Manual (required) - [X] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [x] N/A
mkArtakMSFT
pushed a commit
that referenced
this pull request
Sep 13, 2024
…itialization (#57715) Backport of #57557 to release/8.0 # [Blazor] Invoke inbound activity handlers on circuit initialization Fixes an issue where inbound activity handlers don't get invoked on circuit initialization. > [!NOTE] > This bug only affects Blazor Server apps, _not_ Blazor Web apps utilizing server interactivity ## Description Inbound activity handlers were added in .NET 8 to enable: * Monitoring inbound circuit activity * Enabling server-side Blazor services to be [accessed from a different DI scope](https://learn.microsoft.com/aspnet/core/blazor/fundamentals/dependency-injection?view=aspnetcore-8.0#access-server-side-blazor-services-from-a-different-di-scope) However, prior to the fix in this PR, this feature didn't apply to the first interactive render after the initial page load. This means that when utilizing this feature to access Blazor services from a different DI scope, the service might only become accessible after subsequent renders, not the initial render. This PR makes the following changes: * Updated `CircuitHost` to invoke inbound activity handlers on circuit initialization * Added an extra test to verify that inbound activity handlers work on the initial page load * Updated existing Blazor Web tests to reuse test logic from the non-web tests * This helps to ensure that the feature works the same way on Blazor Server and Blazor Web Fixes #57481 ## Customer Impact The [initial issue report](#57481) was from a customer who was impacted experiencing this problem in their app. The problem does not inherently cause an app to stop working, but if the application code has made the (rightful) assumption that the service accessor is initialized, then session may crash. The workaround is to upgrade the app to use the "Blazor Web App" pattern, although this can be a fairly large change. ## Regression? - [ ] Yes - [X] No The problem has existed since the introduction of the feature in .NET 8. ## Risk - [ ] High - [ ] Medium - [X] Low The change is straightforward, and new tests have been added to ensure that it addresses the issue. Existing tests verify that a new regression is not introduced. ## Verification - [X] Manual (required) - [X] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [x] N/A
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Blazor] Invoke inbound activity handlers on circuit initialization
Fixes an issue where inbound activity handlers don't get invoked on circuit initialization.
Description
Note
This bug only affects Blazor Server apps, not Blazor Web apps utilizing server interactivity
Changes:
CircuitHost
to invoke inbound activity handlers on circuit initializationFixes #57481