Skip to content

fix(ios): fix the launch crash and the doubled safe-area padding - #556

Merged
linroid merged 2 commits into
mainfrom
fix/ios-notification-category-crash
Oct 14, 2026
Merged

linroid merged 2 commits into
mainfrom
fix/ios-notification-category-crash

Conversation

@linroid

@linroid linroid commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Two fixes for the iOS app, both found running it on an iPhone.

Launch crash in IosNotifier

IosNotifier now loads every string resource into a local before it calls the UserNotifications APIs:

  • category() loads the action titles first, then builds the UNNotificationActions and the UNNotificationCategory.
  • registerCategories() builds the category set before setNotificationCategories.
  • notifyPaused() loads the title and body before setting them on UNMutableNotificationContent.

The app crashed at launch with EXC_BAD_ACCESS (code=1, address=0x20) in +[UNNotificationAction actionWithIdentifier:title:options:], called from IosNotifier.category's coroutine, with the debugger showing its arguments as NULL. 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

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. It now uses .ignoresSafeArea() (every region, the keyboard included, as before), and Compose handles the insets alone.

Verification

On an iPhone 16 Pro simulator:

  • A build from main crashes at launch with the stack above; with this branch it launches.
  • Onboarding and the Downloads screen now reach the screen edges, with content just below the status bar and the bottom bar just above the home indicator, instead of sitting between blank bands.

backgroundProgress in KetchBackground.kt also suspends near a constructor, but it builds a Kotlin data class rather than an Objective-C object, so it is left as is.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T05:04:16.088026Z 764d468 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 14, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 1 919 files  +  481   1 946 suites  +481   23m 45s ⏱️ + 4m 58s
12 942 tests +4 293  12 695 ✅ +4 293  247 💤 ±0  0 ❌ ±0 
15 517 runs  +4 293  15 270 ✅ +4 293  247 💤 ±0  0 ❌ ±0 

Results for commit 764d468. ± Comparison against base commit 52130d5.

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.
@linroid linroid changed the title fix(ios): load notification text before calling UserNotifications fix(ios): fix the launch crash and the doubled safe-area padding Oct 14, 2026
@linroid
linroid merged commit f89f9f1 into main Oct 14, 2026
11 checks passed
@linroid
linroid deleted the fix/ios-notification-category-crash branch October 14, 2026 05:23
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.

1 participant