realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.31k stars 2.15k forks source link

'Realm accessed from incorrect thread.' in iOS 18 while in iOS 17 no issue #8668

Open bgoncal opened 2 months ago

bgoncal commented 2 months ago

How frequently does the bug occur?

-- select --

Description

In Home Assistant App we access realm from the Widgets extension and since iOS 18 betas, when accessing Realm directly from the AppIntentProvider it is now crashing with 'Realm accessed from incorrect thread.' while if dispatched in main queue the issue does not happen.

BUT

If dispatched in the main queue then it crashes in iOS 17

Home Assistant PR with the workaround used to prevent that: https://github.com/home-assistant/iOS/pull/2919

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

10.35 (But also tested in 10.52.2)

What Atlas Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 18 and 18.1 (Betas 6 and 2)

Build environment

Xcode version: 15.4 Dependency manager and version: Cocoapods, RealmSwift 10.35

sync-by-unito[bot] commented 2 months ago

➤ PM Bot commented:

Jira ticket: RCOCOA-2422