Skip to content

fix: [SDK-5581] catch Throwable around the startup timeline log - #2812

Merged
abdulraqeeb33 merged 1 commit into
mainfrom
ar/sdk-5581-timeline-throwable
Oct 22, 2026
Merged

abdulraqeeb33 merged 1 commit into
mainfrom
ar/sdk-5581-timeline-throwable

Conversation

@abdulraqeeb33

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Catch Throwable around the startup timeline log so a log listener throwing a checked exception can't fail a finished init.

Details

Follow-up to Fadi's comment on #2811: #2811 (comment)

reportStartupTimeline caught only RuntimeException, but internalInit catches Exception. Kotlin listeners can throw checked exceptions (for example IOException), which slipped past the guard and turned a successful init into FAILED. It now catches Throwable, matching logStartupDiagnostics.

No public API change.

Testing

Unit testing

The existing "log listener that throws" test now throws IOException. It fails with the old catch and passes with the fix. Core unit tests, spotless and detekt pass.

Manual testing

Not needed for a catch widening.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

A Kotlin log listener can throw a checked exception, which internalInit's catch (Exception) would turn into FAILED after a successful init.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

📊 Diff Coverage Report

Diff Coverage Report (Changed Lines Only)

Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff).

Changed Files Coverage

  • OneSignalImp.kt: 1/1 touched executable lines (100.0%) (1 touched lines in diff)

Overall (aggregate gate)

1/1 touched executable lines covered (100.0% — requires ≥ 80%)

📥 View workflow run

@abdulraqeeb33
abdulraqeeb33 merged commit 7418001 into main Oct 22, 2026
6 checks passed
@abdulraqeeb33
abdulraqeeb33 deleted the ar/sdk-5581-timeline-throwable branch October 22, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants