Skip to content

Conversation

@leson1106
Copy link

@leson1106 leson1106 commented Oct 28, 2025

Issue

#349

Goals

Fix crash when comparing two UUIDs, one of which is in a NSManagedObject.

I discovered that under the hood _unconditionallyBridgeFromObjectiveC forces NSUUID with !. Reference UUID_Wrappers.swift

@_effects(readonly)
public static func _unconditionallyBridgeFromObjectiveC(_ source: NSUUID?) -> UUID {
    var result: UUID?
     _forceBridgeFromObjectiveC(source!, result: &result)
    return result!
}
package func state(in store: LoggerStore?) -> NetworkTaskEntity.State? {
    let state = self.state
    if state == .pending, let store, self.session != store.session.id { //👈 💥 crash here
        return nil
    }
    return state
}

This could be an issue if the object is in the process of being deleted but still has reference(s), as indicated in the issue above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants