Fix #123: load NavigationCancelService's JS module lazily, not in the constructor - #124
Open
devel0peter wants to merge 1 commit into
Open
Fix #123: load NavigationCancelService's JS module lazily, not in the constructor#124devel0peter wants to merge 1 commit into
devel0peter wants to merge 1 commit into
Conversation
… constructor The constructor field initialiser started a JS interop import the moment the scoped service was resolved. Under Blazor Server prerendering that is during static rendering, where JS interop throws - and since nothing awaits the stored task unless ProceedAsync later runs, the fault surfaced as a TaskScheduler.UnobservedTaskException logged on every page load of every consuming app, with a finalizer stack that identifies nothing. Import the module on first use inside ProceedAsync instead: by the time a listener cancels a navigation the circuit is interactive, so the confirm dialog behaviour is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
Fixes #123.
NavigationCancelServicestarted a JS interop import in its constructor field initialiser. The service is scoped and resolved during Blazor Server's static prerender pass, where JS interop throws — and since nothing awaits the stored task unlessProceedAsynclater runs, the fault surfaced as aTaskScheduler.UnobservedTaskExceptionlogged at Error level on every page load of every consuming app, with a finalizer stack that identifies nothing (attributed in MagicSuite via aFirstChanceExceptionstack capture — see MS-25810 / panoramicdata/MagicSuite#102).The module is now imported on first use inside
ProceedAsync: by the time a listener cancels a navigation the circuit is interactive, so the confirm-dialog behaviour is unchanged.PanoramicData.Blazorbuilds clean with the change.MagicSuite currently carries a prerender-safe
INavigationCancelServiceoverride registered afterAddPanoramicDataBlazor(); that override will be removed once a version containing this fix is published and consumed.🤖 Generated with Claude Code