Repository navigation
fix(ios): fix the launch crash and the doubled safe-area padding - #556
Merged
Merged
Conversation
Loading a string resource (a suspension) inside the argument list of an Objective-C call lost the arguments evaluated before it on Kotlin/Native, so UNNotificationAction.actionWithIdentifier received null arguments and crashed with EXC_BAD_ACCESS while registering the notification categories. Load every title first, then make the calls.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Contributor
ContentView only ignored the keyboard's safe area, so SwiftUI laid the Compose view out inside the status bar and home indicator, leaving blank bands there, and Compose then padded for WindowInsets.safeDrawing again: every screen got the bars' height twice at the top and bottom. Compose handles the insets itself, so ignore every safe area region.
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.
Two fixes for the iOS app, both found running it on an iPhone.
Launch crash in
IosNotifierIosNotifiernow loads every string resource into a local before it calls the UserNotifications APIs:category()loads the action titles first, then builds theUNNotificationActions and theUNNotificationCategory.registerCategories()builds the category set beforesetNotificationCategories.notifyPaused()loads the title and body before setting them onUNMutableNotificationContent.The app crashed at launch with
EXC_BAD_ACCESS (code=1, address=0x20)in+[UNNotificationAction actionWithIdentifier:title:options:], called fromIosNotifier.category's coroutine, with the debugger showing its arguments asNULL. The call suspended (title.text().load()) inside the argument list of an Objective-C call; on Kotlin/Native the arguments evaluated before the suspension were lost by the time it resumed.Doubled top and bottom padding
ContentViewonly ignored the keyboard's safe area, so SwiftUI laid the Compose view out inside the status bar and home indicator, leaving blank bands there, and Compose then padded forWindowInsets.safeDrawingagain: every screen got the bars' height twice at the top and bottom. It now uses.ignoresSafeArea()(every region, the keyboard included, as before), and Compose handles the insets alone.Verification
On an iPhone 16 Pro simulator:
maincrashes at launch with the stack above; with this branch it launches.backgroundProgressinKetchBackground.ktalso suspends near a constructor, but it builds a Kotlin data class rather than an Objective-C object, so it is left as is.