Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/sentry/utils/sdk_crashes/sdk_crash_detection_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,27 @@ def build_sdk_crash_detection_configs() -> Sequence[SDKCrashDetectionConfig]:
module_pattern="io.sentry.graphql.SentryGraphqlInstrumentation",
function_pattern="instrumentExecutionResultComplete",
),
# WindowCallbackAdapter just forwards the calls to the next callback in the chain.
# It does not cause crashes/ANRs itself.
FunctionAndModulePattern(
module_pattern="io.sentry.android.core.internal.gestures.WindowCallbackAdapter",
function_pattern="*",
),
# All functions that we delegate to are inside lambdas, so we ignore them.
FunctionAndModulePattern(
module_pattern="io.sentry.android.sqlite.SentrySupportSQLiteStatement$*",
function_pattern="invoke",
),
# Our wrapper class does not override beginTransaction, so we ignore it.
FunctionAndModulePattern(
module_pattern="io.sentry.android.sqlite.SentrySupportSQLiteDatabase",
function_pattern="beginTransaction*",
),
# Our wrapper class does not override any move* methods, so we ignore it.
FunctionAndModulePattern(
module_pattern="io.sentry.android.sqlite.SentryCrossProcessCursor",
function_pattern="move*",
),
},
)
configs.append(java_config)
Expand Down
36 changes: 36 additions & 0 deletions tests/sentry/utils/sdk_crashes/test_sdk_crash_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,42 @@ def test_build_sdk_crash_detection_configs(
True,
"Should report a crash when function pattern is wildcard but module doesn't match",
),
(
"invoke_match_module_prefix_with_suffix",
[
FunctionAndModulePattern(
module_pattern="io.sentry.android.sqlite.SentrySupportSQLiteStatement$*",
function_pattern="invoke",
)
],
[
{
"function": "invoke",
"module": "io.sentry.android.sqlite.SentrySupportSQLiteStatement$bindLong$1",
"package": "MyApp",
}
],
False,
"Should not report a crash when module matches SentrySupportSQLiteStatement$* and function is invoke",
),
(
"begin_transaction_match_database_wrapper",
[
FunctionAndModulePattern(
module_pattern="io.sentry.android.sqlite.SentrySupportSQLiteDatabase",
function_pattern="beginTransaction*",
)
],
[
{
"function": "beginTransactionNonExclusive",
"module": "io.sentry.android.sqlite.SentrySupportSQLiteDatabase",
"package": "MyApp",
}
],
False,
"Should not report a crash when beginTransaction* is called on SentrySupportSQLiteDatabase",
),
],
)
def test_sdk_crash_ignore_matchers(
Expand Down
Loading