Skip to content

feature: contain sdk failures instead of crashing the host app - #396

Merged
KishanPRao merged 1 commit into
mainfrom
feature/prod-harden
Sep 28, 2026
Merged

KishanPRao merged 1 commit into
mainfrom
feature/prod-harden

Conversation

@KishanPRao

@KishanPRao KishanPRao commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A failure inside the SDK no longer crashes or changes the host app, the SDK turns that feature off and logs a Backtrace warning.

Changes

  • failureLog.ts: new, one-line Backtrace: warning with the error class, never the error message.
  • index.ts: exports failureLog.
  • AttributeManager.ts: skips a provider that throws.
  • BreadcrumbsManager.ts: addBreadcrumb never throws, re-entry guard for interceptors that log.
  • BacktraceCoreClient.ts: send() never throws or rejects.
  • BacktraceDatabase.ts, BacktraceMetrics.ts: warn instead of leaving an unhandled rejection.
  • BacktraceClient.ts: initialize() never throws, falls back to a disabled client, defaults missing app attributes to unknown, guards each init and dispose step, dispose() clears the singleton.
  • BacktraceClientBuilder.ts: runs JS-only without the native storage modules.
  • CrashReporter.ts: warns on every path that turns native crash reporting off.
  • UnhandledExceptionHandler.ts: the app's global handler always runs.
  • AnrWatchdogHandler.ts: guards the ANR listener and native calls.
  • WebRequestEventSubscriber.ts: keeps synchronous XHR synchronous.
  • ErrorBoundary.tsx: warns instead of throwing without a client.
  • BacktraceReactNative.java: survives a missing native library, converts attribute values to strings.
  • BacktraceDirectoryProvider.java: lists a missing directory as empty.
  • BacktraceFileSystemProvider.java: guards unlink and exists.
  • StreamWriter.java: thread-safe writer map.
  • AnrWatchdog.java, BacktraceAnrWatchdog.java: an exception in the watchdog no longer kills the app.
  • Android attribute providers: return partial attributes when a read throws.
  • iOS attribute providers, OomWatcher.mm, BacktraceCrashReporter.mm: nil-safe.
  • BacktraceReactNative.mm: catches native init and update exceptions.
  • failureContainmentTests.spec.ts, selfHealingTests.spec.ts: new.

ref: BT-7704

@KishanPRao
KishanPRao requested a review from melekr September 23, 2026 14:37
@KishanPRao KishanPRao self-assigned this Sep 23, 2026
@KishanPRao KishanPRao added the enhancement New feature or request label Sep 23, 2026
@KishanPRao
KishanPRao marked this pull request as ready for review September 28, 2026 14:54
@KishanPRao
KishanPRao merged commit 6199f14 into main Sep 28, 2026
12 checks passed
@KishanPRao
KishanPRao deleted the feature/prod-harden branch September 28, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants