…rts once per session
B14-2079, B14-2080, B14-2081 (snabbit app-webview). The web session
marker cleared itself on visibilitychange:hidden, but the 10 s
heartbeat wrote it back as active regardless of visibility. An embedded
WebView keeps running timers after the host pauses it and is then
destroyed without pagehide, so every routine close was reported as an
app_unclean_exit on the next open (~8x the app_startup rate in the
field). The heartbeat now writes the current visibility and the Page
Lifecycle freeze/resume events clear and re-arm the marker; the native
marker's heartbeat writes the current AppState for the same reason.
The marker also records its session's sampling decision and the last
session id it reported: an unsampled session's exit is no longer filed
(it exported nothing else and the lone span escaped sessionSampleRate
for 100 % of sessions), and a session resumed within
sessionTimeoutMinutes is reported at most once instead of once per
reopen.
New enableUncleanExitDetection flag, default true, and on web default
false inside an embedded WebView (Android wv UA token or an iOS
WKWebView UA without Safari/), where the host closes the page with no
unload signal. Docs and CHANGELOG updated; README/ARCHITECTURE no longer
describe the web marker as app_crash.
Summary
Fixes B14-2079, B14-2080 and B14-2081 (snabbit
app-webview-rum, Preact page inside the Expert Android app's WebView).visibilitychange: hiddencleared the marker but the 10 s heartbeat wrote it back as active. An embedded WebView keeps running timers after the host pauses it and is then destroyed withoutpagehide, so every routine close was reported asapp_unclean_exiton the next open (~8× theapp_startuprate on snabbit). The heartbeat writes the current visibility;freeze/resumeclear and re-arm. The native marker's heartbeat writes the currentAppState.sampled; an unsampled session's exit is not filed (it exported nothing else, and the lone span escapedsessionSampleRatefor 100 % of sessions).reportedSessionId, so a session resumed withinsessionTimeoutMinutesis not reported once per reopen.enableUncleanExitDetectionconfig flag: defaulttrue, on web defaultfalseinside an embedded WebView (AndroidwvUA token, iOS WKWebView UA withoutSafari/). Explicit values override the heuristic. Reported in thescout.configlog.Evidence
40/40 live
app_crashspans on snabbit (scout-react 0.1.16):crash.reason=tab_terminated_without_pagehide, no exception, 6 with alifecycle: pausedlast breadcrumb; 39/40session.sampled=false; onecrash.previous_session_idduplicated inside a 53 s sample. Details on the tickets.Tests
crash.test.ts: hidden heartbeat stays inactive,freeze/resume, page created hidden,sampledrecorded and honoured,reportedSessionIdrecorded and honoured, a different session still reports.platform.test.ts:isEmbeddedWebViewUA matrix.unclean-exit-gate.test.ts:Scout.initializearms the marker in a browser, not in a WebView, and both explicit overrides.make cigreen locally (316 tests).Docs
CHANGELOG
[Unreleased],docs/configuration.md(new row,alwaysCaptureErrorsnote),docs/ARCHITECTURE.mdandREADME.mdno longer describe the web marker asapp_crash.Rollout
snabbit runs 0.1.16, where the marker is still emitted as
app_crash. They need this release plus, until they wiresetWebViewBridgesession adoption, the WebView default (orenableUncleanExitDetection: false) in the app-webview build.