Repository navigation
Conversation
|
📲 Install BuildsAndroid
|
Keep both current Unreleased changelog entries after #6301 merged.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a46e24c. Configure here.
| final @Nullable String description = result.getDescription(); | ||
| if (description != null && !description.isEmpty()) { | ||
| breadcrumb.setData("description", description); | ||
| } |
There was a problem hiding this comment.
ANR description may include PII
Medium Severity
The app.anr breadcrumb copies AnrWarningResult.getDescription() into event data with no sendDefaultPii check. For broadcast and similar ANRs the system string is an Intent dump and can include a data URI (phone numbers, mailto, content:// paths, URL query strings). That payload is then attached to later events by default.
Triggered by project rule: PR Review Guidelines for Cursor Bugbot
Reviewed by Cursor Bugbot for commit a46e24c. Configure here.
|
|
||
| if (this.options.isEnableAppLifecycleBreadcrumbs()) { | ||
| scheduleRegisterAnrWarningListener(scopes, this.options); | ||
| } |
There was a problem hiding this comment.
ANR breadcrumbs enabled by default
Low Severity
The new app.anr breadcrumbs are installed whenever enableAppLifecycleBreadcrumbs is on, and that option already defaults to true. There is no separate opt-in for ANR warnings, so every Android 17+ app that leaves the existing lifecycle-breadcrumb toggle unchanged starts sending this new signal.
Triggered by project rule: PR Review Guidelines for Cursor Bugbot
Reviewed by Cursor Bugbot for commit a46e24c. Configure here.
| } | ||
| } catch (RejectedExecutionException e) { | ||
| unregisterAnrWarningListener(options); | ||
| } |
There was a problem hiding this comment.
Unregister can miss executor shutdown
Medium Severity
close() only runs unregisterAnrWarningListener inline when submit throws or the returned Future is already cancelled. A task that is queued and later dropped by executorService.close() → shutdownNow() never unregisters. ActivityManager then keeps the Consumer, which captures scopes and can pin the closed SDK until process death.
Triggered by project rule: PR Review Guidelines for Cursor Bugbot
Reviewed by Cursor Bugbot for commit a46e24c. Configure here.


📜 Description
On Android 17 (API 37) and above,
AppLifecycleIntegrationnow subscribes toActivityManager.registerAnrWarningListener. These usually fire halfway (e.g. input dispatch at 2.5s of the 5s limit, forground service starts at 5s of the 10s limit)Each warning becomes an
app.anrbreadcrumb (type: system,level: warning,message: ANR warning) with this data:anr_type: theAnrTypesconstant as a readable name (for exampleinput_dispatch,broadcast_of_intent,start_foreground_service). An unknown value is kept asunknown (<n>).anr_id,timeout_ms,consumed_msdescription: the description from the system. It is not set if the system gives an empty value.Details:
enableAppLifecycleBreadcrumbsis enabled.Sentry.init.close()unregisters the listener. If the executor drops or rejects the unregister task, it runs inline. A register task that is still in the queue afterclose()does not register the listener.AppLifecycleIntegrationnow takes(Context, BuildInfoProvider)in its constructor. The public no-arg constructor is kept as@Deprecated. With it, the ANR warning listener is not installed.💡 Motivation and Context
The ANR warning arrives before the ANR. If the app then crashes, records an error, or is killed for the ANR, the event breadcrumbs show that the main thread was already slow, and they show which ANR type and how much of the timeout was used.
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
app.anrbreadcrumb to the Android breadcrumbs page.🤖 Generated with Claude Code