getsentry / getsentry/sentry-dart

Source Context support if not using `split-debug-info`

Open
#1,314 6 comments 2 reactions 0 assignees View on GitHub
Dart Errors Improvement
Dominant language
Dart
Stars
873
Forks
299
Avg merge
2d 7h
Merged PRs (30d)
30

Description

### Description

Sentry already offers Source context support but only when using `split-debug-info` as well.
[https://docs.sentry.io/platforms/flutter/troubleshooting/#source-context](https://docs.sentry.io/platforms/flutter/troubleshooting/#source-context)

This issue is to make it possible without the `split-debug-info` as well.
This would need changes in the SDK related to `SentryStackFrame#fileName` and/or `SentryStackFrame#absPath` cus we strip the path to the last segment due to PII.

It might need changes on [https://github.com/getsentry/symbolicator](https://github.com/getsentry/symbolicator) as well.

For context: what is [source context](https://blog.sentry.io/2017/11/08/one-year-of-elixir/#source-code-context).

---

TLDR on making this work:

* we need a "debug id" that would be stored during app build in dart code and sent over when reporting frames - achievable e.g. by --dart-define - this could be called by starting flutter build through the sentry_dart_plugin.
* sentry-cli needs to be updated to support creating source-bundles with custom debug IDs.
* The plugin would use the same debug id when creating a source bundle and uploading to Sentry.
* symbolicator may need an update to resolve these paths

However I'm not positive that we can make this work entirely by running only `flutter run`

---

Update: now that now that [build hooks](https://dart.dev/tools/hooks) are introduced in Dart `3.10.0` this might be achievable

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.