Skip to content

Skip empty runtime drain breadcrumbs on iOS - #324

Open
tiensonqin wants to merge 1 commit into
mainfrom
devin/1796418983-iosb-drain-breadcrumbs
Open

tiensonqin wants to merge 1 commit into
mainfrom
devin/1796418983-iosb-drain-breadcrumbs

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The latest LOGSEQ-IOS-B event (build 80, iOS 18.7.12, Journals, presentation=none) has a main-thread stack of SwiftUI Observation work (GraphHost.runTransaction → AG::Subgraph::update → installObservationSlow → _NativeDictionary.copy) with no app frames. Its 50 retained breadcrumbs were 24 runtime drain_begin/drain_end pairs plus two hosting-controller lifecycle entries. The empty drains pushed out the navigation, UI-state, and user-action breadcrumbs that could identify the trigger.

drainEffects now uses LogseqCrashReporting.RuntimeDrain:

  • When the drain receives its first effect payload (including a malformed one), it records drain_begin with the drain's original start timestamp.
  • finish() records drain_end, preceded by drain_begin if that was not already recorded, when the drain did work or ran for at least 100 ms.
  • It records nothing for a fast drain with no effects, including one that only waited.

Limitation: a slow drain that never returns and never receives an effect records no pair. Sentry's thread samples still cover a hang in that state.

This is diagnostic only and does not change UI behavior. The breadcrumb code is now gated on os(iOS) && LOGSEQ_ENABLE_SENTRY.

Validation:

  • The Sentry-enabled iOS simulator build passes.
  • The sentry-callback-isolation check passes, including a new case: "fast empty drains preserve UI breadcrumbs; work and slow drains retain both markers."
  • The simulator UI suite passes, with 113 tests.
  • swift test was not run.

Mobile Engineer opened this PR for Tienson
Implemented in session Reproduce and fix IOS-B layout hang
Review with Devin · Open in Devin Desktop


@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant