-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
buildId
support for Flutter Web
#53027
Comments
/cc @sigmundch |
cc @rakudrama - I'm curious if you have any reservations here about adding a build-id and what it would entail in our codegen process. @marandaneto thanks for filing this issue. I'm not so sure about whether the approach taken with AOT would be best for the web. I'd like to brainstorm a bit more with you to see what options are best suited here. I was reading a bit more about your approach in https://github.com/getsentry/rfcs/blob/main/text/0081-sourcemap-debugid.md, and was wondering if you could share a bit more about your experience using paths to encode the build-id information outside the program. I saw you've tried paths of the form release/dist/path, but it wasn't clear to me if this included any versioning information. I ask because of our past experience with other customers on this topic. They have approached this as part of their versioning solution, which was necessary for them to address other problems too. In particular, their versioning takes care of:
Their versioning solution is entirely handled in the serving infrastructure. They release their code and assets under URLs of the form
The As you can imagine, that architecture allows pushing out a new version of an app without interfering with existing ones. This benefits the unmangling work as well. Obfuscated error stack frames contain the resource URIs, so they embed the build-id in that way. Their storage of source-map files mimics the same structure, so they can lookup the source-map using the same build-id. Again, because of the structured organization of their storage, the source-map file doesn't need to store the build-id within it. Separately, though, they do have a mapping from build-id to a commit in the history of their repository. This allows them to fetch the correct sources without having to embed the .js sources inlined in the source-map file directly. |
@sigmundch thanks for your message. |
The The
By that you mean, for example, https://docs.sentry.io/A and https://docs.sentry.io/B, look at I'm not sure if we've ever considered this use case, maybe @Swatinem can help us out here since he was part of the new spec. |
It appears as if this is just a recommendation, but it is not enforced by the system. I think that's an important detail - I'd claim that versioning should be required for correctness and for correct error attribution.
Not sure I understood your example. Also, I'm not sure if those URIs are just examples or if they meant to have a running app on the other side (they currently show a PageNotFound error on my end). To illustrate my point about integrity. Imagine 2 versions of the same app, which uses deferred loading. The compiled code consists of two files: Supposed we release v1 and v2 versions of this app. Without versioning paths you have an architecture like:
This causes issues when you deploy a new version if anyone had loaded Using versioning paths you have an architecture like:
This ensures that you can't mix v1 and v2 versions of the app accidentally anymore. |
Hi, thanks for all the hard work.
Relates to #51941
If you're compiling a Flutter Web app, the runtime types (
<obj>.runtimeType.toString()
) are minified, See caveat.Flutter Web apps spit out a source maps file if combined with
--source-maps
, e.g.flutter build web --source-maps
The source maps file contains extension functions that allow the unmangling of such types, https://github.com/dart-lang/sdk/blob/master/pkg/compiler/doc/sourcemap_extensions.md#minified-names-data
For tools such as Sentry.io that have to do the unmangling of such types for debugging reasons, the compiled version of the Flutter web has to be associated with the generated source maps file.
For AOT Apps, you can do this via #51941 using
NativeRuntime.buildId
at runtime and reading the debug file binary metadata that matches thebuildId
, so the association can be made thru thisbuildId
of the compiled app and its debug symbols.For Flutter Web apps, this is not possible, there's no way to read a
buildId
that is available at runtime and after build time to make the association of the Flutter web version and the generated file.The goal of this issue would be a similar API to
NativeRuntime.buildId
for Flutter web, and ideally thisbuildId
would be possible to be read after the App is compiled, or the compiler would inject thebuildId
into the source maps file, read more about that here https://github.com/getsentry/rfcs/blob/main/text/0081-sourcemap-debugid.md#injecting-the-debugid-into-the-sourcemapAfter the error is received, the ingestion pipeline will use this
buildId
to match the correct source map file.Let me know your thoughts, thanks.
The text was updated successfully, but these errors were encountered: