You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 60e30a5
Browse filesBrowse the repository at this point in the historyBrowse files
A push subscription disabled through the REST API (notification_types
-31) was re-enabled by the SDK: RefreshUser discarded the server's
disable state for push, the session-start self-heal re-asserted local
truth over it, and every subscription payload recomputed enabled from
device state.
Mirror the server's disable code on the push model when RefreshUser
reports it, report it back in subscription payloads instead of the
device-derived values, skip the stuck-subscription self-heal for it,
and carry it across the login/logout user switch. The mirror clears
when the server reports any other state and on an explicit optIn().
The 404 recovery paths (user rebuild and update-404 re-create) treat
the dead record's disable as gone and recreate from device truth.
Also remove the mislabeled DISABLED_FROM_REST_API_DEFAULT_REASON(-30)
enum case; no OneSignal API has ever written -30 as a REST disable.
Enum-name persistence now parses leniently in the shared model
accessor, so models and queued operations persisted under an unknown
enum name read as SUBSCRIBED instead of throwing on upgrade.
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/builduser/impl/RebuildUserService.kt
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/operations/CreateSubscriptionOperation.kt
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,8 @@ class CreateSubscriptionOperation() : Operation(SubscriptionOperationExecutor.CR
77
77
* The status of this subscription.
78
78
*/
79
79
var status:SubscriptionStatus
80
-
get() = getEnumProperty(::status.name)
80
+
// A persisted name this build's enum lacks reads as SUBSCRIBED instead of dropping the op batch.
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/operations/UpdateSubscriptionOperation.kt
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,8 @@ class UpdateSubscriptionOperation() : Operation(SubscriptionOperationExecutor.UP
76
76
* The status of this subscription.
77
77
*/
78
78
var status:SubscriptionStatus
79
-
get() = getEnumProperty(::status.name)
79
+
// A persisted name this build's enum lacks reads as SUBSCRIBED instead of dropping the op batch.
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/operations/impl/executors/RefreshUserOperationExecutor.kt
+29-2Lines changed: 29 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,8 @@ internal class RefreshUserOperationExecutor(
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/operations/impl/executors/SubscriptionOperationExecutor.kt
Copy file name to clipboardExpand all lines: OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/operations/impl/listeners/SubscriptionModelStoreListener.kt
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,12 @@ internal class SubscriptionModelStoreListener(
73
73
val status:SubscriptionStatus
74
74
val enabled:Boolean
75
75
76
-
if (model.optedIn && model.status ==SubscriptionStatus.SUBSCRIBED&& model.address.isNotEmpty()) {
76
+
// A REST API disable is server-owned; report it back rather than the device state so
77
+
// subscription payloads don't re-enable a suppressed subscription.
78
+
if (SubscriptionStatus.isRestApiDisable(model.restApiDisabledReason)) {
0 commit comments