Add Sendable conformance to public push notification models - #764
Conversation
Make MBPushNotification, MBAps, MBApsAlert and MBPushNotificationButton conform to Sendable in both the Mindbox and MindboxNotifications targets. All stored properties are value types (String?, Int?, or nested Sendable structs), so the conformance is safe to add without any @unchecked usage. Verified with a build under SWIFT_STRICT_CONCURRENCY=complete: no new warnings or errors, and existing push-notification tests still pass.
|
What's the rule behind this set of four types — a specific integration that hit it, or the start of a general sweep? The rest of the public API ( |
|
Specific integration, not a general sweep. In one of our client apps, the notification-storage layer serializes all reads/writes to the pending-notifications list through a private serial That code is compiled into the app's notification-service-extension and content-extension targets, both of which already build under full Swift 6 language mode. There, I didn't extend this to |
Thanks — we're taking it, but it won't be in a released version before October: release and regression capacity is committed until then, and a public conformance is a minor, not a patch. Is the Swift 6 build blocking a dated release on your side? If so, say so and we'll re-weigh the timing. |
|
Sounds good — Thanks for the quick turnaround and for taking it on. |
Summary
Sendableconformance toMBPushNotification,MBAps,MBApsAlert, andMBPushNotificationButtonin both theMindbox(Mindbox/PublicModels/MBPushNotification.swift) andMindboxNotifications(MindboxNotifications/Models/MBPushNotification.swift) targets.String?,Int?, or nested structs from the same family), so no@unchecked Sendableor other workaround is needed.Why
These are public API types that callers may want to pass across actor/concurrency boundaries (e.g. in async notification-handling code). Without an explicit
Sendableconformance, clients outside the SDK's own module can't rely on it being safe to send, even though structurally it already is.Test plan
xcodebuild ... -scheme Mindbox -destination 'generic/platform=iOS Simulator' build— succeedsxcodebuild ... -scheme MindboxNotifications -destination 'generic/platform=iOS Simulator' build— succeedsSWIFT_STRICT_CONCURRENCY=complete— no new warnings/errors related to these typesMindboxNotificationsTests/PushNotificationParsingTestsandMindboxNotificationsTests/MindboxPushNotificationTests(25 tests) pass unchanged