Skip to content

Blazor Activity links on global render vs per-page rendermode are totally different #64554

@davhdavh

Description

@davhdavh

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

On project with per-page rendermode, the traces are pretty useless.

Microsoft.AspNetCore.Components.Navigate adds links to the route and then stores it in the link store.

_componentsActivityLinkStore!.SetActivityContext(ComponentsActivityLinkStore.Route, activity.Context,

However, when an event handler is run, that is in circuit context, which has a DIFFERENT _componentsActivityLinkStore and thus the links it was supposed to add does not exist.

Expected Behavior

On <Routes @rendermode="InteractiveServer" />
Image
and link to page activity in the event activity:

Image

Steps To Reproduce

  1. make new blank blazor with aspire and global rendermode.
  2. Start project
  3. Click Counter link
  4. Click Increment a few times
  5. Find trace in aspire -> CORRECT
  6. convert app to per-page (or just create another with per-page rendermode)
    a. remove global rendermode
    b. add rendermode to home and counter page
  7. do 2-5 again -> INCORRECT

Exceptions (if any)

On page level @rendermode

Image Image

.NET Version

10.0.100

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions