diff --git a/.pubignore b/.pubignore index 2c2bc17..cd176f7 100644 --- a/.pubignore +++ b/.pubignore @@ -46,4 +46,5 @@ migrate_working_dir/ # The device verification harness (doc/verification.md) and the app it drives: dev tooling, never published. /scripts/device/ /example/lib/verify_main.dart +/example/lib/e2e_main.dart /test/device_harness_test.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index ed76b9e..5906345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ A rewrite for the Bugsee 7.x native SDKs (Android 7.6.0, iOS 7.1.0). **Not published yet; a prerelease.** Existing 9.x apps should stay on 9.x: there is no compatibility layer (the decision is open), see `doc/migration-from-9x.md`. +### Known gaps + +* Symbolication was exercised end to end on apidev (obfuscated release builds on an iPhone XS and an Android phone): Android, including Dart 3.14 stacks, and iOS native + crashes are symbolicated; **iOS Dart exceptions stayed raw** because of a backend symbol-lookup collision (fixes in review: bugsee-appserver#280, bugsee-background-worker#182). + The production endpoint was not used (`doc/verification.md` scenario 11). The harness's own read-back of the backend and its other later checks have not run on a device or backend; the results were read by hand. + On iOS the Dart `.symbols` file and the `App.framework` dSYM share one UUID, so the documented upload flow can leave Dart frames raw until those fixes are deployed (README, symbols section). + ### Features * **Launch and configuration.** `Bugsee.launch(token, {options})` returning `LaunchResult` (`launched`, `alreadyRunning`, `deferred`), diff --git a/PLAN.md b/PLAN.md index 976ae30..9fc6f5c 100644 --- a/PLAN.md +++ b/PLAN.md @@ -27,7 +27,7 @@ Contents: [Status](#status) | [Decisions taken](#decisions-taken) | [Open decisi | Device verification harness (emulator and simulator) | Done, not in CI | [verification](doc/verification.md) | | Documentation pass, migration guide | Done (this pass) | [doc/README.md](doc/README.md) | | **Not exposed on purpose** | APM transactions and spans, the appearance system, `relaunch`, secure rectangles and activities (replaced by `BugseeSecureView`), `deleteCollectedDataOnDevice`, native views | [api-surface](doc/api-surface.md) | -| **Not verified** | any physical device; iOS recovered crash reports and exception bundles (simulator limits); a valid token and the production backend | [verification](doc/verification.md) | +| **Not verified** | the production backend; what a backend (apidev, 2026-11-23) made of the uploaded symbols and crashes: symbolication was read back by hand (apidev, 2026-11-24): Android and iOS native frames symbolicated, iOS Dart exceptions raw until bugsee-appserver#280 and bugsee-background-worker#182 are deployed; the harness's own read-back and its other later checks have never run on a device or backend, see scenario 11 | [verification](doc/verification.md) | ## Decisions taken @@ -87,7 +87,11 @@ Other gaps, none with an issue: reports for native signals, Objective-C exceptions and a Swift trap; a `raise(7)`, which is SIGEMT on Darwin and not SIGBUS (10), left no report; SIGBUS itself is not yet measured on a device). The workbook's iOS recovery claims (off-main, capped, a late completion re-persists) were not measured. * The Gradle plugin 4.0.6 failure arm was not run; `optimizeExtensionsLoading=false` and the feedback safety-net path were not run. -* A real token and the production backend: the harness uses a loopback stand-in; server-side symbolication was run offline with the +* **End-to-end symbolication (2026-11-23/24, `doc/verification.md` scenario 11):** read back from apidev. Android (obfuscated release, R8): everything symbolicated, including the + Dart 3.14 stack. iOS: native crashes symbolicated; **Dart exceptions stay raw** because two ready records share the build-id UUID and the backend's batch lookup returned the + App dSYM (not the Dart `.symbols`): backend bug, fixes in review (bugsee-appserver#280, bugsee-background-worker#182), nothing to change in the wrapper. The tokens exist on + apidev only (production answers `ApplicationNotFoundError`), so the runs used apidev. Next step: re-run the iOS scenario once both fixes are deployed. +* A production-backend run: not done (no production tokens); the harness otherwise uses a loopback stand-in; server-side symbolication was run offline with the backend's `dart_symbolize` (2026-11-18, `doc/exceptions.md`): it decodes the Android arm64 stack of a Dart 3.14 build only because the worker strips the stack's header (with the header it crashes, as Flutter 3.50's `flutter symbolize` does: `_kDartSnapshotText`, no `_kDartIsolateSnapshotInstructions`); its vendored `native_stack_traces` copy is from 2023 and needs a bump to 0.7.x to stop depending on that (owner: the backend; not changed here). A real iOS stack diff --git a/README.md b/README.md index ba9dcff..15803b0 100644 --- a/README.md +++ b/README.md @@ -365,7 +365,13 @@ every build you ship. | iOS native frames (the app, `Flutter.framework`) | the build's dSYMs | **manual in a Flutter app**: a Run Script phase after "Embed Frameworks" running `bugsee-cli xcode upload-dsyms --app-token "$BUGSEE_APP_TOKEN"` ([Bugsee CLI, Xcode](https://docs.bugsee.com/cli/xcode/)), or `bugsee-cli debug-files upload /dSYMs --type dsym --version --build ` in CI; with Xcode 15 and newer set `ENABLE_USER_SCRIPT_SANDBOXING = NO` on the target; `$BUGSEE_APP_TOKEN` must exist in the script's environment (a user-defined build setting of the target named `BUGSEE_APP_TOKEN` does that), and the CLI fails the build, exit code 20, when it is missing or empty | Dart symbols and iOS dSYMs are not uploaded for you by this package: nothing in a Flutter build calls the Bugsee uploader. The iOS -row is taken from Bugsee's CLI documentation and has not been measured with a Flutter build here. +dSYM upload was run once with a Flutter build (an iPhone XS, apidev, `doc/verification.md` scenario 11). + +**Known issue, iOS Dart frames.** On iOS the Dart `app.ios-arm64.symbols` file and the `App.framework` dSYM carry the same UUID. When both +are uploaded (the flow above), the backend currently may pick the dSYM, which has no Dart information, and leave the Dart frames of an +obfuscated build raw (`_kDartSnapshotText+0x...`) while the issue is `ready`. Fixes are in review (bugsee-appserver#280, +bugsee-background-worker#182); until they are deployed, expect this. Native iOS frames and everything on Android were symbolicated in the same +run. Uploading only the `.symbols` file may avoid it; that was not tried. This note goes away once the fixes are deployed and the run is repeated. ## Privacy model diff --git a/doc/design-rules.md b/doc/design-rules.md index d46554a..bcb5fc6 100644 --- a/doc/design-rules.md +++ b/doc/design-rules.md @@ -78,4 +78,4 @@ Feedback package (`packages/bugsee_flutter_feedback`, doc `packages/bugsee_flutt ## Device verification -Device verification (`scripts/device/`, the app `example/lib/verify_main.dart`, results and evidence `doc/verification.md`): workbook Part 9 as a harness, NOT in CI. Its guards are the default and must stay so: the SDK banner's version AND build (`android.sdkBuild`, `ios.sdkBuild` in `native-versions.json`), the artefact set (NDK artefact, Gradle plugin alone at the pin, four `libbugsee*.so`, provider kept at `initOrder` 200; iOS SwiftPM tag AND revision), launched, staged preconditions read back, the death of signal 11 proven (logcat plus exit info, launchd on iOS), a positive control next to every absence. A new check goes through `Run.guard`/`Run.expect`; a new parser goes in `scripts/device/core/` with a test that shows it failing (`test/device_harness_test.dart`, which also holds the drift guards for what the harness repeats). Facts that cost time: the workbook's logcat-grep for four libraries reads 1 to 2 on a correct build (it only sees libraries executed from files in the data directory; measure the in-process pair from `/proc/PID/maps` of the package's own base.apk and the crashpad pair in the handler process's maps); network capture never records the Bugsee endpoint's host, so a check must request another host name (`adb reverse` gives the emulator a second one); the iOS simulator slice has no crash reporter and files no logged exception, so recovered iOS reports and iOS exception bundles need a physical iPhone; `flutter build ios --simulator` fails on Flutter 3.41 / Xcode 27.1 (the harness uses `--config-only` plus `xcodebuild` for one simulator and `ARCHS=arm64`) and release/profile are not buildable for a simulator; iOS bundles are zstd-compressed zips (`dart:io` cannot read them: the mock's `/__plain` re-writes them); the Android report screenshot was all black in the default SurfaceView render mode at SDK 7.4.2 (bugsee-android#316); 7.5.0 captures SurfaceViews and scenario 9 FAILS when the screenshot is one flat colour while the display is not (both render modes are checked), so a black screenshot is a regression, not a known gap; the video frame remains the stronger redaction evidence; a NOT POSSIBLE scenario exits 2 unless `--allow-not-possible`. +Device verification (`scripts/device/`, the app `example/lib/verify_main.dart`, results and evidence `doc/verification.md`): workbook Part 9 as a harness, NOT in CI. Its guards are the default and must stay so: the SDK banner's version AND build (`android.sdkBuild`, `ios.sdkBuild` in `native-versions.json`), the artefact set (NDK artefact, Gradle plugin alone at the pin, four `libbugsee*.so`, provider kept at `initOrder` 200; iOS SwiftPM tag AND revision), launched, staged preconditions read back, the death of signal 11 proven (logcat plus exit info, launchd on iOS), a positive control next to every absence. A new check goes through `Run.guard`/`Run.expect` (the exception is `scripts/device/e2e_symbolication.dart`, a RUN with its own verdict and exit codes 0/1/3 whose checks are tested pure functions in `core/e2e.dart`); a new parser goes in `scripts/device/core/` with a test that shows it failing (`test/device_harness_test.dart`, which also holds the drift guards for what the harness repeats). Facts that cost time: the workbook's logcat-grep for four libraries reads 1 to 2 on a correct build (it only sees libraries executed from files in the data directory; measure the in-process pair from `/proc/PID/maps` of the package's own base.apk and the crashpad pair in the handler process's maps); network capture never records the Bugsee endpoint's host, so a check must request another host name (`adb reverse` gives the emulator a second one); the iOS simulator slice has no crash reporter and files no logged exception, so recovered iOS reports and iOS exception bundles need a physical iPhone; `flutter build ios --simulator` fails on Flutter 3.41 / Xcode 27.1 (the harness uses `--config-only` plus `xcodebuild` for one simulator and `ARCHS=arm64`) and release/profile are not buildable for a simulator; iOS bundles are zstd-compressed zips (`dart:io` cannot read them: the mock's `/__plain` re-writes them); the Android report screenshot was all black in the default SurfaceView render mode at SDK 7.4.2 (bugsee-android#316); 7.5.0 captures SurfaceViews and scenario 9 FAILS when the screenshot is one flat colour while the display is not (both render modes are checked), so a black screenshot is a regression, not a known gap; the video frame remains the stronger redaction evidence; a NOT POSSIBLE scenario exits 2 unless `--allow-not-possible`. diff --git a/doc/exceptions.md b/doc/exceptions.md index 8bcaadd..4bd1be8 100644 --- a/doc/exceptions.md +++ b/doc/exceptions.md @@ -213,6 +213,11 @@ It zips `build/symbols/*.symbols` with a manifest (`{'target':'flutter','items': `POST {endpoint}apps/{token}/symbols` (`{uuid, version, build}`), then `PUT`s the zip to the presigned URL it returns. Keep the symbols of every release you ship; the build id ties a stack to them. +**Known issue (iOS).** The `.symbols` file of an iOS build and the `App.framework` dSYM share one UUID. With both uploaded, the backend +currently may select the dSYM, which holds no Dart information, so the Dart frames stay raw (`_kDartSnapshotText+0x...`) on a `ready` issue, +until bugsee-appserver#280 and bugsee-background-worker#182 are deployed (measured on apidev, `doc/verification.md` scenario 11; Android is +unaffected). Not verified: whether uploading only the `.symbols` file avoids it. Remove this note when the fixes are deployed and the run is repeated. + **Verifying a build's symbols against a captured stack, offline:** ```bash diff --git a/doc/verification.md b/doc/verification.md index dfe9021..0f40439 100644 --- a/doc/verification.md +++ b/doc/verification.md @@ -135,6 +135,7 @@ harness was run again on a new simulator (iPhone 17, iOS 26.5, Xcode 27.1) with | 8 | Hot restart | PASS | PASS | | 9 | Report screenshot by render mode | PASS at Android 7.5.0: content and the secure box redacted in BOTH modes, screenshot and video (at 7.4.2: KNOWN-GAP, all black in the default SurfaceView mode) | not applicable (the iOS screenshot has content, scenario 7) | | 10 | Crash and error matrix: native signals, Java, Dart routes | PASS on a physical phone at Android 7.5.1: see section 10 | not run (no iOS device harness yet) | +| 11 | End-to-end symbolication, real backend | UPLOADED, crashed on the phone, read back (apidev, by hand through the staging MCP): everything symbolicated, Java, native and Dart | UPLOADED, crashed on an iPhone XS, read back (apidev, by hand): native frames symbolicated, **Dart exceptions raw** (backend symbol-record collision, fixes in review: bugsee-appserver#280, bugsee-background-worker#182); not re-measured after the fixes | ## Scenarios @@ -432,8 +433,76 @@ copy decodes both forms. The backend works today only because it strips the head iOS: a Flutter 3.50 `--release --obfuscate --split-debug-info` build (`example`, `lib/verify_main.dart`, no codesign) writes `app.ios-arm64.symbols`, a Mach-O file (`file`: "Mach-O 64-bit dSYM companion file arm64") with `LC_UUID` and the symbols `_kDartSnapshotText`, `_kDartSnapshotData` and `_kDartSnapshotBss`. `dart_symbolize` (and 0.7.1) read it: a SYNTHETIC header-less stack (frames written by hand from the file's own symbol addresses, not captured on a phone) -came out as the right functions with file:line. Not verified: a real iOS stack (its header, whether its frames carry `virt`, the form of its `build_id`, -which should be the `LC_UUID` as 32 hex digits, which the worker looks up by that and by the upper-case dashed UUID), and the iOS upload path. +came out as the right functions with file:line. A real iOS stack and the iOS upload path were measured later, in scenario 11 (a real device stack, uploaded and read back: the `.symbols` decode, but a +second record with the same UUID can make the backend pick the wrong file, see there). + +### 11. End-to-end symbolication against a Bugsee backend (2026-11-23) + +`scripts/device/e2e_symbolication.dart` (app: `example/lib/e2e_main.dart`; parsers and verdicts: `scripts/device/core/e2e.dart`, tested in +`test/device_harness_test.dart`; `scripts/device/symbols_logged.py` runs the pinned `symbols.py` unchanged and prints each HTTP exchange). No mock. + +```bash +# Tokens never go on a command line (shell history, `ps`) or into the repository. Keep them in a private file +# outside the repository (chmod 600) that exports the variables, or type them without echo: +# set -a; . "$HOME/.config/bugsee-e2e.env"; set +a # the file holds BUGSEE_IOS_TOKEN=..., BUGSEE_SERVER_TOKEN=..., the app ids +# read -rs BUGSEE_IOS_TOKEN; export BUGSEE_IOS_TOKEN # or this, per variable +# Variables the run reads (all optional except the token and the device): +# BUGSEE_ENDPOINT (e.g. https://apidev.bugsee.com; empty = the default, production, endpoint) +# BUGSEE_SERVER_TOKEN and BUGSEE_IOS_APP_ID / BUGSEE_ANDROID_APP_ID (to read the backend back; without them the run ends UNVERIFIED, exit 3, never a pass) +# E2E_DEVLOCK (a device lock script: acquire|release ...; or --devlock