Skip to content

UIKit observe Closure Stops Being Called #293

@juliensagot

Description

@juliensagot

Description

Hi everyone, I’m experiencing a major issue with the observe closure when used in conjunction with sharing-grdb.

For some reason, the observe closure randomly stops being called whenever my SharedReader (backed by a FetchKeyRequest) value changes. This leads to crashes in my app, as I’m relying on that closure to generate snapshots for my collection view.

I’ve created a sample project here, where the issue is reproducible. It also includes a failing unit test (running it 5 times is usually enough to observe the issue).

issue.mov

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

SwiftUI Navigation version information

No response

Destination operating system

iOS 18

Xcode version information

16.4.0

Swift Compiler version information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions