Pulse icon indicating copy to clipboard operation
Pulse copied to clipboard

CoreData crash on startup due to duplicated NSEntityDescriptions

Open nenadvulic opened this issue 4 weeks ago • 2 comments

Package: Pulse 5.1.4 Xcode: 16.4 iOS: 18.4 Environment: SwiftUI app using Pulse for logging

Issue

At app startup, the app crashes with a CoreData fatal error. CoreData reports multiple NSEntityDescriptions claiming the same Pulse entities, leading to a type-mismatch crash.

CoreData: warning:      'LoggerSessionEntity' (0x600003508790) from NSManagedObjectModel (0x6000021078e0) claims 'Pulse.LoggerSessionEntity'.
CoreData: warning:      'LoggerSessionEntity' (0x600003508790) from NSManagedObjectModel (0x6000021078e0) claims 'Pulse.LoggerSessionEntity'.
CoreData: warning:      'LoggerSessionEntity' (0x60000350c370) from NSManagedObjectModel (0x600002104b90) claims 'Pulse.LoggerSessionEntity'.
CoreData: warning:      'LoggerSessionEntity' (0x60000350c370) from NSManagedObjectModel (0x600002104b90) claims 'Pulse.LoggerSessionEntity'.

CoreData: debug: PostSaveMaintenance: incremental_vacuum with freelist_count - 1375 and pages_to_free 275

CoreData: warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'Pulse.NetworkTaskEntity' so +entity is unable to disambiguate.
CoreData: warning:      'NetworkTaskEntity' (0x60000350c8f0) from NSManagedObjectModel (0x6000021078e0) claims 'Pulse.NetworkTaskEntity'.
CoreData: warning:      'NetworkTaskEntity' (0x600003500d10) from NSManagedObjectModel (0x600002104b90) claims 'Pulse.NetworkTaskEntity'.

CoreData: warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'Pulse.LoggerMessageEntity' so +entity is unable to disambiguate.

CoreData: warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'Pulse.NetworkRequestEntity' so +entity is unable to disambiguate.

Fatal error: NSArray element failed to match the Swift Array Element type  
Expected LoggerBlobHandleEntity but found LoggerBlobHandleEntity

CoreData: warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'Pulse.NetworkTransactionMetricsEntity' so +entity is unable to disambiguate.

Symptoms

On app launch, Pulse initializes its CoreData store. CoreData reports duplicated entity definitions (same entity class registered multiple times).

App crashes with a fatal error. NSArray element failed to match the Swift Array Element type Even though the class names appear identical, CoreData treats them as different entities from different models, causing a mismatch.

What I Checked

  • There is only one Pulse package in my project (SPM).
  • No custom CoreData models referencing Pulse entities.
  • Clean build folder, remove derived data → crash persists.
  • The crash seems related to Pulse loading multiple NSManagedObjectModels with the same entity names.

nenadvulic avatar Nov 26 '25 11:11 nenadvulic

Do you happen to use some other tools with SDKs that track network requests? For example, Rocketsim?

kean avatar Nov 26 '25 11:11 kean

@kean no, i'm using classic simulator

nenadvulic avatar Nov 26 '25 11:11 nenadvulic