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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
master← Head:ios-realm-crash📝 Commits (1)
7ccd8dbfix: iOS 16 realm crash📊 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
asyncversion 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() asyncconstructor, 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.