Skip to content

Commit 6018f4d

Browse files
committed
No longer hydrate timezone from the server
After the implementation to start updating timezone changes on new sessions, hydrating timezone from the user refresh call will conflict if the timing between the update and refresh requests is not perfect. For example, imagine this scenario if we still hydrate this property: 1. On a new session, timezone detects as changed from US to UK. A property update is enqueued. 2. This request is sent and the refresh user call returns (which still contains timezone as US) 3. The SDK hydrates timezone as US 4. On the next session, timezone is detected as changed from US to UK.
1 parent dedab04 commit 6018f4d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ internal class RefreshUserOperationExecutor(
8989
}
9090
}
9191

92-
if (response.properties.timezoneId != null) {
93-
propertiesModel.timezone = response.properties.timezoneId
94-
}
92+
// No longer hydrate timezone from remote, set locally
93+
propertiesModel.update()
9594

9695
val subscriptionModels = mutableListOf<SubscriptionModel>()
9796
for (subscription in response.subscriptions) {

0 commit comments

Comments
 (0)