Skip to content

Commit 5792403

Browse files
committed
refactor: rename pushSelfHealOperation to mirror builder name
Rename the local variable in RefreshUserOperationExecutor.getUser from pushSelfHealOperation -> pushSelfHealOperationForStuckSubscription so it matches the builder method buildPushSelfHealOperationForStuckSubscription that produces it. Pure rename, no behavior change.
1 parent 06306d0 commit 5792403

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/operations/impl/executors/RefreshUserOperationExecutor.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ internal class RefreshUserOperationExecutor(
107107
val pushSubscriptionIdFromConfig = _configModelStore.model.pushSubscriptionId
108108

109109
val subscriptionModels = mutableListOf<SubscriptionModel>()
110-
var pushSelfHealOperation: UpdateSubscriptionOperation? = null
110+
var pushSelfHealOperationForStuckSubscription: UpdateSubscriptionOperation? = null
111111
for (subscription in response.subscriptions) {
112112
val subscriptionModel = SubscriptionModel()
113113
subscriptionModel.id = subscription.id!!
@@ -135,7 +135,7 @@ internal class RefreshUserOperationExecutor(
135135
// so we don't want to cache these subscriptions from the backend.
136136
if (subscriptionModel.type != SubscriptionType.PUSH) {
137137
subscriptionModels.add(subscriptionModel)
138-
} else if (subscription.id == pushSubscriptionIdFromConfig && pushSelfHealOperation == null) {
138+
} else if (subscription.id == pushSubscriptionIdFromConfig && pushSelfHealOperationForStuckSubscription == null) {
139139
// Self-heal for users stuck at "Never Subscribed". Older SDK builds dispatched
140140
// the merged create-subscription + update-subscription(SUBSCRIBED) batch as a
141141
// POST /subscriptions carrying the already-existing server-side id; the server
@@ -147,7 +147,7 @@ internal class RefreshUserOperationExecutor(
147147
// re-assert local truth via PATCH. "Device is the source of truth" is the
148148
// existing policy for push; this just enforces it across the wire when the
149149
// server has drifted out of sync.
150-
pushSelfHealOperation = buildPushSelfHealOperationForStuckSubscription(op, subscription, pushSubscriptionIdFromConfig)
150+
pushSelfHealOperationForStuckSubscription = buildPushSelfHealOperationForStuckSubscription(op, subscription, pushSubscriptionIdFromConfig)
151151
}
152152
}
153153

@@ -167,7 +167,7 @@ internal class RefreshUserOperationExecutor(
167167

168168
return ExecutionResponse(
169169
ExecutionResult.SUCCESS,
170-
operations = pushSelfHealOperation?.let { listOf<Operation>(it) },
170+
operations = pushSelfHealOperationForStuckSubscription?.let { listOf<Operation>(it) },
171171
)
172172
} catch (ex: BackendException) {
173173
val responseType = NetworkUtils.getResponseStatusType(ex.statusCode)

0 commit comments

Comments
 (0)