Observe async EventCallback faults instead of dropping them. - #340
Open
MayaKirova wants to merge 4 commits into
Open
Observe async EventCallback faults instead of dropping them.#340MayaKirova wants to merge 4 commits into
MayaKirova wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a long-standing issue in the Ignite UI for Blazor event pipeline where exceptions from asynchronous consumer EventCallback handlers could go unobserved (because the returned Task was inspected before it had faulted). This is addressed by introducing a shared helper in BaseRendererControl and switching multiple two-way binding implementations to use it.
Changes:
- Added
BaseRendererControl.ObserveHandlerTask(Task)to observe delayed faults fromEventCallback.InvokeAsync(...). - Replaced synchronous
task.Exceptioninspections across multiple components’ two-way binding paths withObserveHandlerTask(...). - Updated Tabs’ selected-tab synchronization to use the shared task observation helper.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/componentsBase/WebInputs/Tabs.cs | Uses ObserveHandlerTask when invoking SelectedChanged during tab sync. |
| src/componentsBase/BaseRendererControl.cs | Adds ObserveHandlerTask and uses it in SetHandler* to observe callback task faults. |
| src/components/Blazor/Textarea.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/Slider.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/Select.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/Rating.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/RadioGroup.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/Radio.cs | Uses ObserveHandlerTask for CheckedChanged invocation in two-way bind propagation. |
| src/components/Blazor/MaskInput.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/Input.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/DateTimeInput.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/DateRangePicker.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/DatePicker.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/Combo.cs | Uses ObserveHandlerTask for ValueChanged invocation in two-way bind propagation. |
| src/components/Blazor/Chip.cs | Uses ObserveHandlerTask for SelectedChanged invocation in two-way bind propagation. |
| src/components/Blazor/CheckboxBase.cs | Uses ObserveHandlerTask for CheckedChanged invocation in two-way bind propagation. |
| src/components/Blazor/Calendar.cs | Uses ObserveHandlerTask for both ValueChanged and ValuesChanged invocations in two-way bind propagation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Description
The old code did:
Exception is only populated once the task is in the Faulted state. For any async consumer handler, InvokeAsync returns a still-running task, so task.Exception is null at the point of inspection and the delayed failure vanishes.
So adding a handler
ObserveHandlerTaskthat handles both the sync scenario and throws (same as before) and handling for a still running task so that delayed faults are observed.Type of Change (check all that apply):
Component(s) / Area(s) Affected:
All that have two-way bind: Calendar, Checkbox, Combo, Radio, RadioGroup etc.
How Has This Been Tested?
Checklist:
README.MDCHANGELOG.MDupdates for newly added functionalityCloses #338