chore(deps): update Android SDK to v8.58.0 - #1173
github-actions[bot] wants to merge 1 commit into
Conversation
d4eec0d to
d214afa
Compare
d214afa to
88c515f
Compare
bbca653 to
858847d
Compare
858847d to
004996a
Compare
004996a to
90a5389
Compare
90a5389 to
e636389
Compare
d92dff6 to
37553fe
Compare
37553fe to
28f2eb0
Compare
a7f71ca to
4996d09
Compare
4996d09 to
4e1e1aa
Compare
4e1e1aa to
f2f750c
Compare
8376130 to
0d5e663
Compare
0d5e663 to
fb4892c
Compare
49011b6 to
546a567
Compare
546a567 to
fce6360
Compare
fce6360 to
9a239de
Compare
9a239de to
75ed20e
Compare
36b3504 to
7cc3b01
Compare
7cc3b01 to
c1bb04c
Compare
c1bb04c to
e66b608
Compare
e66b608 to
a145bbb
Compare
a145bbb to
61100a6
Compare
61100a6 to
fbd60dd
Compare
| dependencies { | ||
| implementation project(':capacitor-android') | ||
| implementation 'io.sentry:sentry-android:8.41.0' | ||
| implementation 'io.sentry:sentry-android:8.51.0' |
There was a problem hiding this comment.
Bug: The captureEnvelope method does not create the outbox directory before writing, a new requirement in sentry-java 8.51.0, which can lead to silent event loss.
Severity: HIGH
Suggested Fix
Before the call to InternalSentrySdk.captureEnvelope in SentryCapacitor.java, ensure the outbox directory exists. This can be done by getting the outbox path from the Sentry options and calling new File(outboxPath).mkdirs().
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: android/build.gradle#L94
Potential issue: The update to `sentry-java` version 8.51.0 requires that the outbox
directory is created before writing envelopes to it. The `captureEnvelope` method in
`SentryCapacitor.java` calls `InternalSentrySdk.captureEnvelope` without first creating
this directory. If the directory does not exist, the operation will fail. This failure
is caught and results in a rejected promise on the JavaScript side, causing events to be
silently dropped instead of being sent to Sentry. This is a functional regression that
leads to data loss.
Also affects:
android/src/main/java/io/sentry/capacitor/SentryCapacitor.java:259~270
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fbd60dd. Configure here.
| dependencies { | ||
| implementation project(':capacitor-android') | ||
| implementation 'io.sentry:sentry-android:8.50.1' | ||
| implementation 'io.sentry:sentry-android:8.58.0' |
There was a problem hiding this comment.
Bug: The dependency bump for the Sentry Android SDK may cause silent data loss. The code relies on an internal API, InternalSentrySdk.serializeScope(), whose structure could have changed, leading to missing event data.
Severity: MEDIUM
Suggested Fix
Verify the structure of the map returned by InternalSentrySdk.serializeScope() in Sentry Android SDK v8.58.0. If the keys have changed, update the code to use the new keys. Consider adding logging for when expected keys are not found to make future breakages more visible. If possible, switch to a public, stable API to avoid this issue with future updates.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: android/build.gradle#L94
Potential issue: The code relies on the internal Sentry API
`InternalSentrySdk.serializeScope()` to fetch native device contexts and log attributes,
specifically checking for keys like `"breadcrumbs"`, `"contexts"`, and `"release"`. The
Sentry Android SDK is being upgraded across 8 minor versions (8.50.1 to 8.58.0). As this
is an internal, undocumented API, its return structure may have changed. If the key
names in the map returned by `serializeScope()` have been altered in the new version,
the existing `containsKey()` checks will fail silently. This will not cause a crash but
will result in the loss of native context and breadcrumbs from Sentry events, leading to
incomplete diagnostic data.

Bumps scripts/update-android.sh from 8.50.1 to 8.58.0.
Auto-generated by a dependency updater.
Changelog
8.58.0
Features
Add
LocalSentrySpantosentry-composeso apps can provide a parentISpanto a composable subtree and have nestedSentryTracedspans attach to it ([#6112]feat(compose): Introduce LocalSentrySpan sentry-java#6112)Add
dataCollection, a fine-grained replacement forsendDefaultPii, for controlling data collected automatically by SDK integrations (#5759)dataCollectionis not configured, the SDK preserves the existingsendDefaultPiibehavior.dataCollectionoption makes it the source of truth.sendDefaultPiiis then ignored, and omitteddataCollectionoptions use the defaults below.sendDefaultPii=truecontinues to include the original message template and parameters. To opt in independently ofsendDefaultPii, set<includeUnencodedMessage>true</includeUnencodedMessage>on the Sentry appender inlogback.xmlorlogback-spring.xml.Sentry.setUser, scopes, event processors, orbeforeSendis not affected.To opt in to the documented
dataCollectiondefaults without configuring an individual option:userInfotruecookies{ mode: DENY_LIST, terms: [] }httpHeaders.request{ mode: DENY_LIST, terms: [] }httpHeaders.response{ mode: DENY_LIST, terms: [] }httpBodiesurlQueryParams{ mode: DENY_LIST, terms: [] }graphql.documenttruegraphql.variablestruedatabaseQueryDatatruefilePathstrueCookies, HTTP headers, and URL query parameters support three modes:
OFF: Do not collect the category.DENY_LIST: Collect values except those matching the built-in sensitive deny-list or additional configured terms.ALLOW_LIST: Only send plaintext values for matching terms. The built-in sensitive deny-list still applies.Matching is case-insensitive and partial. The built-in sensitive deny-list contains
auth,token,secret,password,passwd,pwd,key,jwt,bearer,sso,saml,csrf,xsrf,credentials,session,sid, andidentity. Filtered values are replaced with"[Filtered]". Custom deny-list terms extend rather than replace this list.Configure all HTTP body types, a custom cookie deny-list, a request-header allow-list, and disable URL query parameter and file path collection in an options callback:
Configure the same options in
sentry.properties:Configure them with Spring Boot properties:
Configure them in
AndroidManifest.xml:See the Data Collection documentation for all configuration keys, supported integrations, and migration guidance.
Fixes
META-INF/MANIFEST.MFfiles during version detection so that the SDK no longer keeps jar file handles open for the life of the process (#6124EventListenerwrapped bySentryOkHttpEventListenerperCall(#6003)8.57.0
Behavioral Changes
Features
MemoryLimiterapp exits recovered fromApplicationExitInfo(#6111).sentry-log4j2is on the classpath and Log4j2 Core is the active logging backend (#5403)sentry.logging.enabled=trueINFO:sentry.logging.minimum-breadcrumb-level=INFOERROR:sentry.logging.minimum-event-level=ERRORINFO:sentry.logging.minimum-level=INFOsentry.logs.enabled=truesentry-log4j2is on the classpath and Log4j2 Core is the active logging backend (#6072)sentry.logging.enabled=true)Fixes
wsandwssURL parsing for WebSocket instrumentation (#6064)Sentry.close()or a re-init. Closing the SDK shut down the shared hostname cache for the life of the process, soserver_namesilently froze at the value it had last resolved (#6119)Internal
RateLimiter(ICurrentDateProvider, SentryOptions)in favor ofRateLimiter(SentryOptions), whose backoff is measured on a monotonic ticker (#6030)AndroidCurrentDateProvider.getInstance()in favor ofMonotonicTicker, which counts time spent in deep sleep and cannot be confused with the epoch-basedCurrentDateProvider(#6103)8.56.0
Fixes
SentryTracedso that it now honorsoptions.setIgnoredSpanOrigins(#6058)SentryTracednow checks for its owning transaction dynamically rather than once per app process. The latter causedSentryTracedspans to be dropped process-wide once the original transaction finished (#6057)GrahQLtoGraphQL) (#6061)SentryTracedfrom producing dangling spans if recomposition is abandoned or drawing fails (#6049)contexts.appand theapp.startspan attributes (#6006)Improvements
ui.composespan perSentryTracedon initial composition instead of one on every recomposition, and set the origin onui.renderspans (#6051)Internal
MonotonicTickerabstraction withDeadlineandStopwatchprimitives (#6028)Timestamp,EpochClockandAnchoredClock, so related instants project from one wall-clock reading instead of each reading the clock (#6045)Dependencies
8.55.0
Features
Session.State.Unhandledfor unhandled errors that do not terminate the process (#5919)Improvements
Fixes
Sentry.withScopeandSentry.withIsolationScopedata to events captured inside the callback whenglobalHubModeis enabled (#6004)globalHubModeis enabled by default on Android, where tags, extras, contexts and level set inside the callback were silently droppedSentry.setCurrentScopesor theSentryContextcoroutine integration, are now also honoured whenglobalHubModeis enabledSentry.pushScope,Sentry.pushIsolationScopeandSentry.popScoperemain no-ops whenglobalHubModeis enabledprofiler_idfrom transactions and spans when no Perfetto profile covers them, e.g. when Android'sProfilingManagerrate limits the profiling request (#6015)Internal
InternalSentrySdk.captureEnvelopeNonTerminatingfor hybrid SDKs (e.g. Flutter) so unhandled exceptions that don't terminate the process no longer end the session ascrashed(#5921)InternalSentrySdk.updateSessionForDroppedEventNonTerminatingso hybrid SDKs can still update the session when an error is dropped by sampling (#5990)Dependencies
8.54.0
Features
app.vitals.start.screenandapp.vitals.start.typeon standaloneapp.startchildren (#6005)SentryFeedbackOptions.setEnableAttachScreenshot(false)or theio.sentry.feedback.enable-attach-screenshotmanifest flag.androidx.activity>=1.8.2dependencySentry.replay()(#5978)start()andstartBuffering()calls bypass the configured replay sample rates; sampling still controls automatic startup.start()starts a full-session replay and does nothing if one is already recording.startBuffering()keeps a rolling buffer that is sent onflush()or an error, then continues in session mode.stop()ends the current replay; the nextstart()creates a new replay session.pause()suspends recording untilresume()and remains paused across background and foreground transitions and automatic replay restarts in the same process.resume()continues the same manually paused replay.flush()sends the current replay data, or starts a full-session replay when recording is stopped.Fixes
null.prefix before default-package class names when parsing Java and JNI frames from Android ANR thread dumps (#5979)Performance
Dependencies
8.53.0
Features
ISpan(#5929)ISpan.startChildoverloads withSpanOptionspublic (#5927)Sentry.feedback().enableOnShake(),Sentry.feedback().disableOnShake(), andSentry.feedback().isOnShakeEnabled()to toggle and query shake-to-report at runtime (#5827)Improvements
ApiStatus.Experimentalannotation fromSentrySQLiteDriver(#5938)Fixes
Scope.clear()(#5902)Throwableidentities when R8 optimizes Android apps (#5881)Performance
Process.getElapsedCpuTime()instead of parsing/proc/self/stat(33.6kB to 16 bytes per sample on a Pixel 3) (#5926)Dependencies
8.52.0
Fixes
ClientReportRecordernow reads the item count from the envelope item header instead of deserializing the payload, which under sustained rate limiting could pin CPU cores while repeatedly throwing exceptionsISentryExecutorServiceas cancelled (#5874)NoOpSentryExecutorServicepreviously returned aFuturethat was never run and never cancelled, so callers could not tell a dropped task from a queued one andget()would block until its timeoutPerformance
SentryFrameMetricsCollectorduringSentry.init(#5886)shutdownTimeoutMilliswhen closing the SDK with a pending transaction timeout or session-end task (#5851)RGB_565instead ofARGB_8888for screenshot and replay capture bitmaps, halving per-frame memory usage (#5821)SentryPerformanceProvider, which was allocated on every cold start inContentProvider.onCreatewithout ever being acquired (#5871)HostnameCacheworker thread now times out while idle instead of staying alive for the whole process lifetime (#5817)Dependencies
8.51.0
Features
ProfilingManager(Perfetto) for continuous profiling on API 35+ devices (#5251)ProfilingManagerwith Perfetto-based stack sampling, providing lower-overhead and more accurate profiles. No configuration change is required.Debug-based profiler.enableLegacyProfilingoption (defaulttrue) to disable the legacyDebug-based profiler. Setting it tofalsedisables continuous profiling on API < 35 devices as well as transaction-based profiling (profilesSampleRate/profilesSampler) on all devices, since transaction-based profiling is not supported by Perfetto.io.sentry.profiling.enable-legacy-profilingmanifest flag.Behavioral Changes
Sentry.init(#5792)SentryOptions.getOutboxPath()andSentryOptions.getCacheDirPath()are not guaranteed to exist onceSentry.initreturns.captureEnvelope— create the directory first, e.g.new File(outboxPath).mkdirs().Improvements
Fixes
checkCanRecordruns on the replay executor thread (#5837)MediaMuxerwhen the replay video encoder fails to start to avoid a resource leak (#5607)androidinstead ofjava) on ANR profile chunks so they are billed as UI Profile Hours rather than Continuous Profile Hours (#5836)ratelimit_backoffdiscarded events in client reports, so they no longer disappear from drop statistics. One event is recorded per buffer flush rather than per segment.Performance
mkdirs()calls off the init (main) thread (#5792)LifecycleWatchernow schedules the session-end task on the shared timer executor instead of creating a dedicatedjava.util.Timerthread (#5819)RateLimiternow schedules its rate-limit-lifted notifications on the shared timer executor instead of creating a dedicatedjava.util.Timerthread (#5814)Dependencies