Skip to content

Commit dbb8bde

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 dbb8bde

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ internal class RefreshUserOperationExecutor(
7373
val propertiesModel = PropertiesModel()
7474
propertiesModel.onesignalId = op.onesignalId
7575

76+
// Note: No longer hydrate timezone from remote
77+
7678
if (response.properties.country != null) {
7779
propertiesModel.country = response.properties.country
7880
}
@@ -89,9 +91,8 @@ internal class RefreshUserOperationExecutor(
8991
}
9092
}
9193

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

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

0 commit comments

Comments
 (0)