fix(ios): Honor shutdownTimeout on iOS - #6749
Merged
Merged
Conversation
JS `shutdownTimeout` (milliseconds) was silently ignored on iOS. Cocoa's dictionary parser only reads `shutdownTimeInterval` (an NSTimeInterval in seconds), so the native default (2s) was always used. Android was already correct via `setShutdownTimeoutMillis`. Map `shutdownTimeout` (ms) to `shutdownTimeInterval` (s) in RNSentryStart, dividing by 1000. Adds Cocoa unit tests for the mapping and the default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
antonis
commented
Sep 17, 2026
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8061d47. Configure here.
📲 Install BuildsAndroid
|
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 64630e5+dirty | 3842.70 ms | 1218.11 ms | -2624.60 ms |
| b0d3373+dirty | 3831.75 ms | 1227.29 ms | -2604.46 ms |
| b04af96+dirty | 3818.92 ms | 1219.76 ms | -2599.16 ms |
| 3d31fcf+dirty | 3838.09 ms | 1223.46 ms | -2614.63 ms |
| a0a3177+dirty | 3844.73 ms | 1225.23 ms | -2619.51 ms |
| af33f3b+dirty | 3849.98 ms | 1236.45 ms | -2613.53 ms |
| 09a902f+dirty | 3835.67 ms | 1217.11 ms | -2618.57 ms |
| 5a316ea+dirty | 3820.11 ms | 1211.28 ms | -2608.83 ms |
| acd838e+dirty | 3849.78 ms | 1230.00 ms | -2619.78 ms |
| c2e182c+dirty | 3848.40 ms | 1211.79 ms | -2636.61 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 64630e5+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| b0d3373+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| b04af96+dirty | 4.98 MiB | 6.54 MiB | 1.56 MiB |
| 3d31fcf+dirty | 4.98 MiB | 6.56 MiB | 1.58 MiB |
| a0a3177+dirty | 4.98 MiB | 6.55 MiB | 1.58 MiB |
| af33f3b+dirty | 4.98 MiB | 6.51 MiB | 1.54 MiB |
| 09a902f+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| 5a316ea+dirty | 4.98 MiB | 6.51 MiB | 1.53 MiB |
| acd838e+dirty | 5.15 MiB | 6.70 MiB | 1.55 MiB |
| c2e182c+dirty | 4.98 MiB | 6.50 MiB | 1.52 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5fe1c6c+dirty | 1201.36 ms | 1209.15 ms | 7.78 ms |
| 7c6200e+dirty | 3828.16 ms | 1217.20 ms | -2610.95 ms |
| 41d6254+dirty | 3849.78 ms | 1233.91 ms | -2615.86 ms |
| 5789645+dirty | 3841.36 ms | 1214.81 ms | -2626.55 ms |
| a9df5ce+dirty | 3856.02 ms | 1225.22 ms | -2630.80 ms |
| 9c84b9a+dirty | 3833.41 ms | 1221.79 ms | -2611.62 ms |
| 1a2e7e0+dirty | 3852.95 ms | 1233.78 ms | -2619.18 ms |
| a636fa4+dirty | 3846.16 ms | 1210.10 ms | -2636.05 ms |
| 9b5615c+dirty | 3837.21 ms | 1215.33 ms | -2621.89 ms |
| 3d31fcf+dirty | 3857.46 ms | 1237.17 ms | -2620.29 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5fe1c6c+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 7c6200e+dirty | 5.08 MiB | 6.68 MiB | 1.60 MiB |
| 41d6254+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 5789645+dirty | 4.98 MiB | 6.50 MiB | 1.52 MiB |
| a9df5ce+dirty | 4.98 MiB | 6.55 MiB | 1.57 MiB |
| 9c84b9a+dirty | 4.98 MiB | 6.55 MiB | 1.57 MiB |
| 1a2e7e0+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| a636fa4+dirty | 4.98 MiB | 6.55 MiB | 1.57 MiB |
| 9b5615c+dirty | 4.98 MiB | 6.51 MiB | 1.53 MiB |
| 3d31fcf+dirty | 4.98 MiB | 6.56 MiB | 1.58 MiB |
antonis
marked this pull request as ready for review
September 17, 2026 13:55
alwx
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
The documented
shutdownTimeoutoption was silently ignored on iOS, so the native SDK always used its default 2s flush interval on app close.Two mismatches with Cocoa caused it:
shutdownTimeout, but Cocoa's dictionary parser only readsshutdownTimeInterval.shutdownTimeoutis milliseconds (matching Android'ssetShutdownTimeoutMillis), while Cocoa'sshutdownTimeIntervalis anNSTimeIntervalin seconds.RNSentryStart.mnow readsshutdownTimeout(ms) and setsshutdownTimeInterval = value / 1000.0. Android was already correct.The option is already documented for React Native (Transport Options →
shutdownTimeout); this fix simply makes iOS honor it, so no docs change is needed.💡 Motivation and Context
shutdownTimeoutcontrols how long the SDK waits to flush events before the app terminates — directly affecting whether events survive termination. It was a documented, promised option that was broken on iOS. Fixes #6748.💚 How did you test it?
Added
RNSentryCocoaTesterunit tests asserting the ms→s mapping (shutdownTimeout: 5000→shutdownTimeInterval == 5.0) and the default (shutdownTimeInterval == 2.0).📝 Checklist
🔮 Next steps
None.
🤖 Generated with Claude Code