[PR #387] [MERGED] fix: iOS 16 realm crash #1422

Closed
opened 2026-04-24 23:58:20 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf-app/pull/387
Author: @ronaldheft
Created: 9/17/2022
Status: Merged
Merged: 9/18/2022
Merged by: @advplyr

Base: masterHead: ios-realm-crash


📝 Commits (1)

📊 Changes

2 files changed (+3 additions, -3 deletions)

View changed files

📝 ios/App/App/plugins/AbsAudioPlayer.swift (+1 -1)
📝 ios/App/Shared/player/PlayerProgress.swift (+2 -2)

📄 Description

Using the async version of Realm on iOS 16 is resulting in incorrect thread crashes. This fix changes the async Realm calls to use the synchronized version by using a different constructor.

Realm() == Realm(queue: DispatchQueue = nil)

But when calling Realm in an async method, the code is picking up the Realm() async constructor, which we don't want.

By calling Realm(queue: nil) we force the non-async path.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf-app/pull/387 **Author:** [@ronaldheft](https://github.com/ronaldheft) **Created:** 9/17/2022 **Status:** ✅ Merged **Merged:** 9/18/2022 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `ios-realm-crash` --- ### 📝 Commits (1) - [`7ccd8db`](https://github.com/advplyr/audiobookshelf-app/commit/7ccd8db085a370df4ad4e5b3dbfeb85d4d71a11d) fix: iOS 16 realm crash ### 📊 Changes **2 files changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `ios/App/App/plugins/AbsAudioPlayer.swift` (+1 -1) 📝 `ios/App/Shared/player/PlayerProgress.swift` (+2 -2) </details> ### 📄 Description Using the `async` version of Realm on iOS 16 is resulting in incorrect thread crashes. This fix changes the async Realm calls to use the synchronized version by using a different constructor. `Realm()` == `Realm(queue: DispatchQueue = nil)` But when calling Realm in an async method, the code is picking up the `Realm() async` constructor, which we don't want. By calling `Realm(queue: nil)` we force the non-async path. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-24 23:58:20 +02:00
adam closed this issue 2026-04-24 23:58:21 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1422