Skip to content

feat(dart): Fall back to token-level remapping for compound exception types - #7

Open
anurag6569201 wants to merge 1 commit into
qa/agent-getsentry-sentry/pr-07-123151/basefrom
qa/agent-getsentry-sentry/pr-07-123151/head
Open

anurag6569201 wants to merge 1 commit into
qa/agent-getsentry-sentry/pr-07-123151/basefrom
qa/agent-getsentry-sentry/pr-07-123151/head

Conversation

@anurag6569201

Copy link
Copy Markdown

Obfuscated Flutter apps often build an exception type out of a label plus a runtime type, like 'Bloc ${bloc.runtimeType}'. That arrives as Bloc aBc, and since the symbol map only contains aBc, 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 aBc becomes Bloc 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 to raw_type — already exposed by the API as rawType, 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 aBc would rewrite in into an unrelated framework class. Short types on their own still resolve, because they match on the full string.

Review note: exception.type always 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: 6fb8998f89ee806aef6f772939dfef6f2b2358f8
Source head: 176cdc78f2d70ad6619662a644fa062d4ef699e0

@shipwright-agent

Copy link
Copy Markdown

⛔ Shipwright · Blocked

Recommendation: do not merge PR #7 · Tier T2
Checks: 0 total · 0 needing attention

Next step: resolve the blocking findings before merge.

Findings (2)

  • 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 · tests/sentry/lang/dart/test_utils.py:700
    • Fix: Review the cited evidence, fix the risk if confirmed, and rerun 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 · tests/sentry/lang/dart/test_utils.py:700
    • Fix: Fix the review finding before release.

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 /shipwright rerun to verify again.

mock_project = mock.Mock(id=123)

data: dict[str, Any] = {
"project": 123,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant