realm-swift icon indicating copy to clipboard operation
realm-swift copied to clipboard

After upgrading to 10.52.0 our app crashes on launch when we attempt to observe a collection

Open dmorgereth opened this issue 1 year ago • 2 comments

How frequently does the bug occur?

Always

Description

Other than upgrading to v 10.52.0 there have been no changes to the app. The app works fine with version 10.51.0. In version 10.52.0 the app crashes the first time we try to observe a Realm collection (for changes) Screenshot 2024-06-18 at 5 10 47 PM

Stacktrace & log output

See attached screen shot

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

10.52.0

What Atlas Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 17.4, Realm 10.52.0

Build environment

Xcode version: xCode 15.3 Dependency manager and version: Swift Package Manager

dmorgereth avatar Jun 19 '24 00:06 dmorgereth

➤ PM Bot commented:

Jira ticket: RCOCOA-2400

sync-by-unito[bot] avatar Jun 19 '24 00:06 sync-by-unito[bot]

It looks like #8295 made it so that we're now exposing a frozen SectionedResults from @ObservedSectionedResults. You can work around this by explicitly calling thaw(), but we should maybe see if we can avoid this.

tgoyne avatar Jun 19 '24 01:06 tgoyne

I am currently experiencing the same issue, but downgrading to 10.51.0 unfortunately does not help. Using @ObservedSectionedResults works correctly; @tgoyne where and what would you thaw() exactly to work around the problem?

MatteoGgl avatar Jul 20 '24 10:07 MatteoGgl

You need to call thaw() on the results instance before you call .observe() on it.

nirinchev avatar Jul 22 '24 13:07 nirinchev