Skip to content

Commit ad18462

Browse files
docs(android): Note that captureEnvelopeNonTerminating writes to disk
The caveat that hybrid SDKs call this off the main thread used to live on the persist helper and was lost when that helper was inlined. It matters more now that the write is synchronous, so state it where callers read it. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 40929e9 commit ad18462

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,13 @@ public static SentryId captureEnvelope(
227227
* <li>keeps session status {@code Ok} and the same session id on the scope
228228
* <li>does not attach a session update item to this envelope
229229
* <li>does not start a new session
230-
* <li>persists the current session so the flag survives process death
230+
* <li>persists the current session before returning, so the flag survives process death
231231
* </ul>
232232
*
233+
* <p>Persisting is a blocking disk write on the calling thread, so call this off the main thread
234+
* as the hybrid SDKs do. It is synchronous on purpose: a deferred write would not be on disk yet
235+
* if the process dies right after this returns.
236+
*
233237
* <p>The session is finalized later by normal lifecycle ({@code endSession} / background /
234238
* previous-session recovery) as {@code unhandled}, unless a terminal status takes over first,
235239
* such as {@code crashed} for a native crash or {@code abnormal} for an ANR.

0 commit comments

Comments
 (0)