Skip to content

[Bug]: ReactiveUI Blazor OnActivate notification issue #4317

@martinbu

Description

@martinbu

Describe the bug 🐞

Since the major version upgrade to v23 RX Subscriptions that notify changes with RaisePropertyChanged inside WhenActivated does not update the ui correctly in the "setup phase".

Step to reproduce

I studied the new code and observed the following:

  1. WhenActivated is called (in OnInitialize of Blazor Lifecycle) and an rx chain is setup binding its output to e.g. a reactive property
  2. Blazor UI Rendering is done
  3. The Reactive property in 1. is updated
  4. ViewModel Change detection is setup (OnAfterRender of Blazor Lifecycle)

As the change detection is setup "last" the RaisePropertyChanged in 3. is not recognized and the UI does not show the "latest" state.

Therefore, the ViewModel change detection setup is performed too late and misses notifications.

Reproduction repository

https://github.com/reactiveui/ReactiveUI

Expected behavior

Notifications done in the WhenActivated code should not be missed in the setup phase. Maybe it would be possible to "buffer" all notifications until the change detection setup has finished.

Screenshots 🖼️

No response

IDE

No response

Operating system

Windows

Version

Windows 11

Device

PC

ReactiveUI Version

23.1.8

Additional information ℹ️

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions