Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix concurrency issue with Blaze local notification scheduler #14012

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
20.6
-----
- [internal] Logging for app storage size added in Core Data crash logs [https://github.com/woocommerce/woocommerce-ios/pull/14008]
- [internal] Fixed concurrency issue with Blaze local notification scheduler. [https://github.com/woocommerce/woocommerce-ios/pull/14012]

20.5
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ import Combine

protocol BlazeLocalNotificationScheduler {
func observeNotificationUserResponse()

@MainActor
func scheduleNoCampaignReminder() async

@MainActor
func scheduleAbandonedCreationReminder() async

@MainActor
func cancelAbandonedCreationReminder() async
}

Expand Down Expand Up @@ -87,7 +93,6 @@ final class DefaultBlazeLocalNotificationScheduler: BlazeLocalNotificationSchedu

/// Schedules abandoned Blaze campaign creation local notification if applicable
///
@MainActor
func scheduleAbandonedCreationReminder() async {
guard await isEligibleForBlaze() else {
DDLogDebug("Blaze: Store not eligible for Blaze. Don't schedule abandoned campaign creation local notification.")
Expand Down Expand Up @@ -118,7 +123,6 @@ final class DefaultBlazeLocalNotificationScheduler: BlazeLocalNotificationSchedu

/// Cancels abandoned Blaze campaign creation local notification
///
@MainActor
func cancelAbandonedCreationReminder() async {
await scheduler.cancel(scenario: .blazeAbandonedCampaignCreationReminder)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@
argument = "mocked-network-layer"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-com.apple.CoreData.ConcurrencyDebug 1"
isEnabled = "YES">
Comment on lines +127 to +128
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small nit: I think you left the ConcurrencyDebug check enabled here 🙌

Copy link
Contributor Author

@itsmeichigo itsmeichigo Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmusolino I intentionally enabled that as default for now. This would only affect debug build runs. Could you share why we should avoid this?

</CommandLineArgument>
<CommandLineArgument
argument = "-stripe-verbose-logging"
isEnabled = "NO">
Expand Down