kean / Pulse

Network logger for Apple platforms
https://pulselogger.com
MIT License
6.18k stars 294 forks source link

fix: wrong background context for exporting and filtering entities #259

Closed jasesuperhero closed 2 months ago

jasesuperhero commented 2 months ago

Context

In my project, I enabled the "-com.apple.CoreData.ConcurrencyDebug" option, and the app started crashing. I was puzzled by this because everything seemed fine at first glance.

After some investigation, I realized the issue: we are creating a new entity for the store while using a shared store and its background context to remove unnecessary session entities. This mismatch in the queue is causing the crash.

Afterward, I added CoreData debug flags to the demo targets to identify and resolve the issue more quickly and easily.

kean commented 2 months ago

Great catch, and thank you for enabling the debug flags.