Connectivity: Crash in Connectivity.startPathMonitorNotifier()

My app is crashing and later in Firebase Crashlytics I found out this:

	Connectivity  0x1007a3f6c outlined assign with take of Any? (<compiler-generated>)
	Connectivity  0x1007a1984 closure #1 in Connectivity.startPathMonitorNotifier() + 257 (Connectivity.swift:257)

So it seems that there is an issue with setting path: self?.path = path

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Thanks for the additional information and no problem 👍🏻 I have considered splitting this out into a separate Cocoapod (without Reachability / Obj-C) in the past for people who don’t need to support older versions of iOS and don’t want any Obj-C in their codebase - I may do so if there is a demand for it. I think I’ve discovered the true cause of the issue now so I’ll need to produce another fix for this - hopefully I’ll have this for you by the end of the day.

No problem - hope this updates resolves the issue!

After a bit of digging I think the real issue was caused by access to the path property not being thread-safe. I’ve added a little code in 3.0.4 to try to ensure that when the path property is updated it is done in a thread-safe manner. I think this should resolve the issue 👍🏻

Thanks @rwbutler I updated my app as well and will check if it has any issues!

I have almost the same exact stack as the one above. It’s nice to find the fix is already in progress. Thanks for the library!

thanks) I will test this update soon 😃

I’ve refactored a significant portion of library now so that the status property is stored rather than computed (version 3.1.0). With any luck this should resolve the crash you were experiencing🤞🏻

I upgraded to new version and will monitor how it is working. Thanks for this library! 😃