Detect for timezone changes and update the user#1542
Merged
Conversation
* Unless users switch via logging in and out, we never update timezone (as it is only sent in the Create User request). * Now, we cache timezone ID and detect for changes on cold starts and update the user when it changes. * We also fix a rare issue that comes from upgrading from an old version of player model to user model. When we have a legacy player ID, we fetch its identity rather than creating a user. Thus, in some rare cases, this old player is already missing a timezone, and the SDK never calls Create User to set a timezone. As a result, this user will be missing timezone. * As a one-time migration, we send up the timezone for all users without considering if timezone is indeed missing or not. Note that this update will be combined in the payload of the session_count update. This update is driven by reading the timezone_id from cache, but before this PR, timezone was never cached, so it will return null.
Contributor
Author
|
Test |
jkasten2
approved these changes
Feb 13, 2025
This was referenced Feb 14, 2025
Merged
This was referenced Feb 25, 2025
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Send up timezone ID as a one-time migration, send up timezone ID when fetching the legacy player, and start detecting timezone changes and sending it up when it changes.
Details
session_countupdate. This update is driven by reading thetimezone_idfrom cache, but before this PR, timezone was never cached, so it will return null, driving this one-time update.Motivation
Reports by customers about missing timezones on very old players after migrating to v5.
Also requests by customers to detect timezone changes.
Scope
Sending timezone
Testing
Unit testing
None added
Manual testing
iPhone 13 on iOS 18.1
Scenario tested - player model upgrade:
Scenario tested - user model upgrade:
mainScenario tested - new install:
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is