Skip to content

MAUI: errors captured in C# never send the on-error session replay #5998

Done

Description

@jamescrosswell

On Android and iOS, MAUI records session replays through the native SDKs. With OnErrorSampleRate (buffer mode), the native SDK keeps the last 30 seconds and uploads them only when it captures an error itself. An exception captured in C# goes through the .NET SentryClient instead, so the native SDK never hears about it and the buffered replay is never sent.

#5990 adds a hook to SentryClient (IReplaySession.CaptureReplay), and getsentry/sentry-unity#2948 uses it for Unity. MAUI still needs three things:

  • The built-in session has to capture natively. Implement CaptureReplay in ReplaySession:
    • Android: ReplayController.captureReplay, which returns the replay id as of sentry-java 8.65.0.
    • iOS: SentryObjCInternalReplayApi.capture, then read replayId. That interface isn't in the Cocoa bindings yet.
  • The client has to use the built-in session. The hook returns early unless options.ReplaySession is set, so MAUI never reaches it.
  • Android reports a replay id while it is only buffering. ReplaySession.ActiveReplayId reads ReplayController.ReplayId. sentry-java sets that id as soon as buffering starts, so in buffer mode MAUI Android events probably point at a replay that is never uploaded. Read the native scope's replay id instead, like Unity's AndroidReplaySession does. iOS already reads the scope.

Related: #5990, getsentry/sentry-unity#2948

Activity

  1. linear-code commented on Nov 24, 2026

    @linear-code
  2. added
    Bug
    and removed on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Bug

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions