feat(dart): Fall back to token-level remapping for compound exception types - #7
Conversation
… types Source PR: getsentry#123151 Source head: 176cdc7
⛔ Shipwright · BlockedRecommendation: do not merge PR #7 · Tier
Findings (2)
Fireworks usage: 13,722 input · 265 output · 13,987 total tokens · $0.0032 · 8s · 0 fix iteration(s) Open the Shipwright check for full evidence and the audit bundle. Use |
| mock_project = mock.Mock(id=123) | ||
|
|
||
| data: dict[str, Any] = { | ||
| "project": 123, |
There was a problem hiding this comment.
Shipwright · CRITICAL
The killswitch test 'test_deobfuscate_exception_type_compound_killswitch' lacks '@django_db_all', but 'deobfuscate_exception_type' now calls 'options.get("dart.compound-type-deobfu
Impact: The killswitch test 'test_deobfuscate_exception_type_compound_killswitch' lacks '@django_db_all', but 'deobfuscate_exception_type' now calls 'options.get("dart.compound-type-deobfuscation.enabled")', which requires database access. This test will fail in CI with a database access error, blocking the merge.
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.
| mock_project = mock.Mock(id=123) | ||
|
|
||
| data: dict[str, Any] = { | ||
| "project": 123, |
There was a problem hiding this comment.
Shipwright · HIGH
The killswitch test 'test_deobfuscate_exception_type_compound_killswitch' is missing the '@django_db_all' decorator, but it calls 'deobfuscate_exception_type' which accesses 'optio
Impact: The killswitch test 'test_deobfuscate_exception_type_compound_killswitch' is missing the '@django_db_all' decorator, but it calls 'deobfuscate_exception_type' which accesses 'options.get(...)'. The option registration and access require database access, so this test will fail with a database access error when run.
Suggested fix: Fix the review finding before release.
Obfuscated Flutter apps often build an exception type out of a label plus a runtime type, like
'Bloc ${bloc.runtimeType}'. That arrives asBloc aBc, and since the symbol map only containsaBc, the lookup on the full string missed and issue titles stayed half-obfuscated.Deobfuscation now falls back to remapping the identifiers inside the type when the full string has no match, so
Bloc aBcbecomesBloc CheckoutBloc. The full-string lookup still runs first and wins. Punctuation, generics and whitespace are preserved exactly, exception values keep their current behavior, and the original type is saved toraw_type— already exposed by the API asrawType, the same way Java ProGuard does it, so there is no frontend change.Identifiers under three characters are skipped. A symbol map includes the Flutter framework, which is large enough to use up every one- and two-character name, so short words are always keys: without a floor,
Error in aBcwould rewriteininto an unrelated framework class. Short types on their own still resolve, because they match on the full string.Review note:
exception.typealways feeds the grouping hash, so events whose types start resolving will split into new issues once after deploy.dart.compound-type-deobfuscation.enabled(on by default) turns off the fallback if that or anything else misbehaves.Refs sentry-dart#3902
Source merge-base:
6fb8998f89ee806aef6f772939dfef6f2b2358f8Source head:
176cdc78f2d70ad6619662a644fa062d4ef699e0