Skip to content

investigate: why do we capture screenshot separate from events #2643

@JoshuaMoelans

Description

@JoshuaMoelans

Follow-up issue to #2641

There might be a good pre-existing reason to it, but this isn't clear from the code/docs. The rendering order compared to Unreal is different (so screenshots are only available at EndOfFrame), but maybe there is a possibility of delaying the event capture until after the screenshot was captured?


The (broken as reported in #2641) flow is currently

SentrySdk.CaptureMessage("...") → SentryClient.cs:316 — DoSendEvent(@event) begins
SentryClient.cs:356 — ProcessEvent calls ScreenshotEventProcessor.Process(@event)
ScreenshotEventProcessor.cs:30 — queues coroutine with @event in closure
SentryMonoBehaviour.cs:69 — StartCoroutine → coroutine runs until yield return WaitForEndOfFrame() → pauses
SentryClient.cs:362 — BeforeSend runs → returns null → event dropped
SentryClient.cs:365 — returns SentryId.Empty
End of frame:

ScreenshotEventProcessor.cs:54 — coroutine resumes, BeforeCaptureScreenshot callback runs
ScreenshotEventProcessor.cs:59 — captures screenshot
ScreenshotEventProcessor.cs:95 — CaptureAttachment(@event.EventId, attachment) — sends orphaned envelope

Metadata

Metadata

Assignees

No one assigned

    Labels

    Attachmentsissue relates to attachments, i.e. screenshots, view hierarchy, file attachmentsBugsomething isn't working as it shouldUnityplatform label
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions