Skip to content

Observe async EventCallback faults instead of dropping them. - #340

Open
MayaKirova wants to merge 4 commits into
masterfrom
mkirova/fix-338
Open

Observe async EventCallback faults instead of dropping them.#340
MayaKirova wants to merge 4 commits into
masterfrom
mkirova/fix-338

Conversation

@MayaKirova

Copy link
Copy Markdown
Contributor

Description

The old code did:

var task = handler?.InvokeAsync(a);
if (task.Exception != null) throw task.Exception;

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 ObserveHandlerTask that 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):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog

Component(s) / Area(s) Affected:

All that have two-way bind: Calendar, Checkbox, Combo, Radio, RadioGroup etc.

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code
  • This PR includes API docs for newly added methods/properties
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Closes #338

Copilot AI lite review requested due to automatic review settings August 19, 2026 11:50
@MayaKirova MayaKirova added the ❌ status: awaiting-test PRs awaiting manual verification label Aug 19, 2026
Comment thread src/componentsBase/BaseRendererControl.cs Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from EventCallback.InvokeAsync(...).
  • Replaced synchronous task.Exception inspections across multiple components’ two-way binding paths with ObserveHandlerTask(...).
  • 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.

Comment thread src/componentsBase/BaseRendererControl.cs Outdated
Comment thread src/componentsBase/BaseRendererControl.cs
Comment thread src/componentsBase/BaseRendererControl.cs
MayaKirova and others added 2 commits August 21, 2026 14:05
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>
Comment thread tests/IgniteUI.Blazor.Tests/InteropEventTests.cs Fixed
Comment thread tests/IgniteUI.Blazor.Tests/InteropEventTests.cs Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Callback awaiting and error routing issue

3 participants