Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter class types symbolication (AOT and Web) #1565

Open
marandaneto opened this issue Jul 21, 2023 · 1 comment
Open

Flutter class types symbolication (AOT and Web) #1565

marandaneto opened this issue Jul 21, 2023 · 1 comment

Comments

@marandaneto
Copy link
Contributor

marandaneto commented Jul 21, 2023

Description

Depends on getsentry/sentry#48334, dart-lang/sdk#51941

For AOT-compiled apps, it's currently not possible to symbolicate class types because debug files don't contain the minified name to associate with the symbolicated name.
The very same problem exists with Flutter Web and source maps, the source maps contain the minified name but not the symbolicated name.

When compiling your Fluter app with obfuscation enabled, you can combine it with an extra parameter that spits out a mapping file (--save-obfuscation-map).

flutter build ios --split-debug-info=symbols --obfuscate --extra-gen-snapshot-options=--save-obfuscation-map=mapping.json

The mapping.json file contains the information we need to symbolicate class types.

This file should be uploaded to Sentry via the Dart plugin and Sentry CLI, then the Sentry symbolication process should take that into consideration, it's somehow similar to a proguard mapping file.

The first thing that should be symbolicated is the exception.type which is responsible for building the issue's titles as well.
We can expand that later on for VH, breadcrumbs, etc.

For Flutter Web, there's no way to associate the mapping file via a buildId of sorts, the current way is only possible via release and dist similar to source maps which is problematic, hence asking support for that natively (Also on Web) dart-lang/sdk#51941.

For Flutter AOT apps, Flutter's beta channel already supports reading the buildId at runtime, via dart-lang/sdk#51941
It'd be possible to associate the mapping file with this Id, most likely we need to associate the mapping file with multiple Ids since the apps can be compiled with different architectures/bundles/etc, most likely generating multiple buildIds, but still a single mapping file.

Sentry-CLI/or tools like readelf could read the buildIds (code id section) of the compiled binaries and upload the mapping file making the association with such Ids.
Sentry SDK sets the buildId at runtime in the event.debug_meta similar to proguard, so the only process left is to do the symbolication during event ingestion.

@marandaneto
Copy link
Contributor Author

For Flutter web, this can be done by getsentry/symbolic#807 on the server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Blocked
Development

No branches or pull requests

1 participant