kean / Pulse

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

Deadlock in LoggerStore.shared init #246

Closed cpd closed 3 months ago

cpd commented 5 months ago

Pulse 4.0.5

Creating a proxy delegate (let delegate = URLSessionProxyDelegate()) leads to deadlock because of Coredata performBlockAndWait

image

TCA on main thread

image

Pulse

image

after wrapping these in an async block

image

the app is stuck in LoggerStore.postInitialization()

image

using async version fixes problem but since I have zero experience with core data this is probably wrong solution

image
kean commented 3 months ago

Thanks for the detailed report, @cpd. It should be fixed in https://github.com/kean/Pulse/releases/tag/4.1.1. Workaround: make sure the store is initialized somewhere in your app delegate before you record any logs – simply access LoggerStore.shared to get it initialized.