Skip to content

Core Data: Multithreading violation when retrieving reminder information #20842

@staskus

Description

@staskus

Core Data: Multithreading violation when setting blogging reminders.

Could be the cause of crashes in the production: #20840

Steps to reproduce the behavior

  1. Set blogging reminders (as described in Core Data: Multithreading violation when setting blogging reminders #20841)
  2. Pass -com.apple.CoreData.ConcurrencyDebug 1 arguments on launch
  3. Open Jetpack app and log in
  4. Observe Multithreading_Violation

It happens when reschedulePromptRemindersIfNeeded is triggered which checks for the notification settings and then accesses BloggingPromptSettingsReminderDays.getActiveWeekdays from a different thread

#0	0x00000001845323a0 in +[NSManagedObjectContext __Multithreading_Violation_AllThatIsLeftToUsIsHonor__] ()
#1	0x0000000184531f7c in _PFAssertSafeMultiThreadedAccess_impl ()
#2	0x0000000184530f6c in _sharedIMPL_pvfk_core_c ()
#3	0x0000000105f1b4f0 in BloggingPromptSettingsReminderDays.getActiveWeekdays() at /Users/povilasstaskus/Projects/WordPress-iOS/WordPress/Classes/Models/BloggingPromptSettingsReminderDays+CoreDataClass.swift:19
#4	0x0000000105556148 in closure #1 in BloggingPromptCoordinator.reschedulePromptRemindersIfNeeded(for:completion:) at /Users/povilasstaskus/Projects/WordPress-iOS/WordPress/Classes/ViewRelated/Blog/Blogging Prompts/BloggingPromptCoordinator.swift:129
#5	0x0000000105556328 in thunk for @escaping @callee_guaranteed (@guaranteed UNNotificationSettings) -> () ()

CoreData.Issue.2.mov
Jetpack iOS 22.6

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions