Skip to content

[Bug]: RegisterHandler no longer resumes on the captured context #4393

Description

@DHR60

Describe the bug 🐞

AI-assisted draft (reviewed and verified before posting).

After the recent performance refactoring, Interaction.RegisterHandler appears to no longer execute handlers on the captured SynchronizationContext.

In my testing, a UI handler registered from a View resumes on a ThreadPool thread, causing UI operations to fail unless they are explicitly dispatched back to the UI thread.

This seems to be related to the addition of .ConfigureAwait(false) after YieldToCurrentContext(), but I'm not sure whether this change was intentional.

Step to reproduce

  1. Register an Interaction handler from a View.
  2. Inside the handler, check SynchronizationContext.Current (or access a UI-only API).
  3. Trigger the interaction.

The handler resumes on a ThreadPool thread instead of the captured UI context.

Reproduction repository

No response

Expected behavior

RegisterHandler should resume on the captured context after YieldToCurrentContext(), matching the behavior before the refactoring and allowing UI handlers to execute without additional dispatching.

Screenshots 🖼️

No response

IDE

No response

Operating system

No response

Version

No response

Device

No response

ReactiveUI Version

No response

Additional information ℹ️

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions