feat: implement dart-symbol-map upload command#1085
Conversation
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1ddfa41. Configure here.
| `Invalid debug ID format: '${debugId}'. Expected UUID format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`, | ||
| "debug-id" | ||
| ); | ||
| } |
There was a problem hiding this comment.
Debug ID validation too strict
High Severity
validateDebugId only accepts a plain 36-character hyphenated UUID, but Sentry debug IDs from native companion files (e.g. dSYM) are often the full DebugId string with an optional lowercase hex appendix after the UUID. IDs from debug-files check in that form fail validation even though the upload API expects them.
Reviewed by Cursor Bugbot for commit 1ddfa41. Configure here.
dbc387c to
1cfb00e
Compare
Port the legacy `sentry-cli dart-symbol-map upload` command. Uploads
Dart/Flutter obfuscation maps to Sentry for deobfuscating Dart
exception types, using the DIF chunk-upload protocol.
Key design decisions:
- Requires `--debug-id <uuid>` flag (not a companion debug file)
since native binary parsing requires the Rust `symbolic` crate.
The sentry-dart-plugin already extracts the debug ID before calling
this command, so `--debug-id` is the practical interface.
- Validates the map file is a JSON array of strings with even length
- `--no-upload` validates without uploading (no auth needed)
- Uses the same DIF assemble endpoint as ProGuard uploads:
`projects/{org}/{project}/files/difs/assemble/`
- Includes `debug_id` in the assemble body to link the map to its
companion native debug file (dSYM/ELF)
Files:
- src/lib/api/dart-symbols.ts \u2014 DIF chunk-upload API module
- src/commands/dart-symbol-map/upload.ts \u2014 command implementation
- src/commands/dart-symbol-map/index.ts \u2014 route map
- src/app.ts \u2014 route registration
- test/commands/dart-symbol-map/upload.test.ts \u2014 11 tests
Codecov Results 📊❌ Patch coverage is 46.51%. Project has 4970 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 81.41% 81.29% -0.12%
==========================================
Files 377 380 +3
Lines 26480 26567 +87
Branches 17251 17295 +44
==========================================
+ Hits 21559 21597 +38
- Misses 4921 4970 +49
- Partials 1788 1792 +4Generated by Codecov Action |


Summary
Part of #1055 — implements
sentry dart-symbol-map upload, porting the legacy Rust sentry-cli's dart symbol map upload functionality.What it does
Uploads Dart/Flutter obfuscation maps to Sentry for deobfuscating Dart exception types. Uses the DIF chunk-upload protocol (same as ProGuard uploads).
How it works
projects/{org}/{project}/files/difs/assemble/with the debug IDKey design decision:
--debug-idflag instead of companion debug fileThe legacy Rust CLI accepts a companion native debug file (dSYM/ELF) and extracts the debug ID using the
symbolicRust crate. We can't parse native binaries in pure TS.However, this is fine because the sentry-dart-plugin (the primary consumer) already extracts the debug ID via
sentry-cli debug-files checkbefore calling this command. So--debug-id <uuid>is the practical interface — no functionality is lost.Flags
--debug-id/-d--no-upload--jsonValidation
The mapping file must be:
Files
src/lib/api/dart-symbols.tssrc/commands/dart-symbol-map/upload.tssrc/commands/dart-symbol-map/index.tssrc/app.tstest/commands/dart-symbol-map/upload.test.tsTesting
11 tests covering:
--no-uploaddry-run (human + JSON output)-dalias for--debug-id