fix(mobile): name the screen the person is on, from an app-owned list

The screen table moves out of shared/diagnostics to lib/diagnostic_screens.dart
and reaches the observers through diagnosticScreenClassifierProvider, which the
root scope overrides. The shared conversation pane no longer imports every
feature page.

A route hosting a navigator with a page open past its first, such as a phone
conversation over the channel list, is named by that page, so closing a cover
over an open channel records the channel. A screen equal to the last one is
skipped, which removes the doubled crumbs from pane hosts and wide section
changes while keeping the pane placeholder's crumb after sign-in.

Adding a community is named addCommunity, the hosted setup route is named
onboarding, and the Duo channel sheet route leaves no crumb.

Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>
Signed-off-by: Tom Brow <tomb@block.xyz>
This commit is contained in:
Tom Brow
2026-11-20 12:09:56 -08:00
parent a0da08fde7
commit b540d470c3
11 changed files with 416 additions and 170 deletions

View File

@@ -46,7 +46,7 @@ A build that is given a [reporting destination](../CONTEXT.md#reporting-destinat
- **Networking measurements.** Every request through the app's shared HTTP client and every relay connection event (connected, disconnected, reconnect attempt, request timed out, subscription closed by the relay) is counted with four attributes: backend, endpoint, outcome and kind of failure. The backend is the host name of the server the app was talking to. Endpoints are names from a fixed list, never raw paths. Durations are recorded for requests and for time to connect. HTTP is measured where the app's shared HTTP client already classifies transport failures; relay connections are measured by hand in the relay session, since the SDK documents no WebSocket instrumentation.
- **Counts are handed to the SDK as they happen**, including while the network is down. The app does no buffering of its own, and the SDK's default limit on unsent data is kept. Accepted consequence: in a long outage the oldest unsent reports can be dropped.
- **No log lines in step one.** The counts carry the member and the time. The first implementation task confirms that the destination can filter counts by member; if it cannot, the fallback is one log line per outage, sent after it ends.
- **Breadcrumbs come from a fixed list:** networking events and screen names, written by the app, and the app moving to the foreground or background, written by the SDK. A screen name comes from the app's own list of screens (such as the channel list, a channel, a thread or settings), with any other page called "other". It is never a channel or community name, an ID, a route's settings or anything a screen shows, so a report shows which screens the person was on and not what they were looking at. A breadcrumb is left when the person moves to a page or back to one. Dialogs, sheets and menus leave none. The SDK's other automatic breadcrumbs, which could carry content or addresses, are turned off or filtered.
- **Breadcrumbs come from a fixed list:** networking events and screen names, written by the app, and the app moving to the foreground or background, written by the SDK. A screen name comes from the app's own list of screens (such as the channel list, a channel, a thread or settings), with any other page called "other". It is never a channel or community name, an ID, a route's settings or anything a screen shows, so a report shows which screens the person was on and not what they were looking at. A breadcrumb is left when the person moves to a page or back to one, unless it names the same screen as the one before. Dialogs, sheets and menus leave none. The SDK's other automatic breadcrumbs, which could carry content or addresses, are turned off or filtered.
- **Who a report is about.** The member's public key is set as the report's user when a session starts and cleared when it ends. When the session is a Builderlab account, the Builderlab's origin and the account's subject identifier are added, never its email address. Every report also carries the app's own random per-install identifier, created on first launch and kept in a file that device backups and transfers skip, so a phone restored from another gets its own, as a separate field, signed in or not, so reports from one device can be matched to the members who used it, and a member's reports to the devices they used. With no member set, for example before sign-in, the SDK fills the report's user with its own random per-install identifier, on Dart and native reports alike. On iOS, native crash and hang reports also carry the SDK's device app hash: a hash of the identifier iOS gives the app's vendor, the hardware model and the bundle identifier, stable across launches and across a reinstall while another app from the same vendor stays installed. The Dart filter drops it, so Dart reports don't carry it. The SDK also sends session records, so the destination can show a crash-free rate. A session begins each time the app starts or returns after 30 seconds or more in the background. The SDK sends a record when it begins, an update each time an error is counted, and a last record when it ends. Together they carry when the session started, how many errors it had, how it ended (normally, crashed or abnormally), the time from start to end (not time in active use), the release, the environment and the SDK's identifier.
- **One filter before anything leaves.** Errors, breadcrumbs and counts from Dart all pass through a single filter that removes URL query strings and fragments, drops any attribute not on the allowed list, replaces every error's own text with fixed wording, drops what the SDK adds about the failing widget or platform call, and keeps only the app, operating system, device and runtime details among the report's contexts, so the SDK's accessibility settings, locale and the device's own name stay on the device. An error keeps its type and stack trace. The SDK's options for sending personal data, screenshots, view hierarchies and session recordings stay off.
- **Main-thread hangs** are captured by the SDK's own hang detection, at the SDK's default thresholds. The app's Dart code runs on the platform's main thread, so Dart work that blocks it shows up here. On iOS, the SDK reports the main thread being blocked, fully or mostly, for 2 seconds or more while the app is active, with the main thread's stack taken during the hang, including freezes the app recovers from. A hang that is still going when the app is killed, for example by the system watchdog, is sent on the next launch as a fatal hang. The SDK's separate watchdog-termination tracking also reports, on the next launch, a run that ended while the app was in the foreground with nothing else to explain it; it never reports on simulators or for kills in the background. App hang detection is off while a debugger is attached ([sentry-cocoa 9.35.0](https://github.com/getsentry/sentry-cocoa/blob/9.35.0/Sources/Swift/Integrations/AppHangTracking/SentryHangTrackingIntegration.swift)). On Android the SDK reports only freezes the system itself declared "app not responding". On Android 11 and later it reports only one that ended the process, read from the system's exit records on the next launch: the most recent unreported one, and only when the system kept a usable thread dump. Before Android 11 it reports when the main thread has been blocked for 5 seconds and the system has marked the app not responding, never with a debugger attached ([sentry-java 8.64.0](https://github.com/getsentry/sentry-java/blob/8.64.0/sentry-android-core/src/main/java/io/sentry/android/core/AnrIntegrationFactory.java)). So with these defaults, a freeze the app recovers from is reported on iOS, and on Android only before Android 11 and only once the system has marked the app not responding. Dart frames in a hang's stack are readable only with the Dart code's debug symbols at the destination, the same as for crashes.