chore: update game bridge to 1.45.9 #241
Merged
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.
Summary
The device code authentication works well on Android, iOS, and Mac, but the Unity SDK encounters issues on Windows. After logging in, the user's OIDC data stored in localStorage often disappears when reopening the game. This happens because Windows initially stores localStorage items in memory, unlike IndexedDB, which writes directly to disk. Upon looking at the Chromium source code for version 122.0.6261.130, local storage items only get committed after every 5 seconds. Additionally, this line is also the other cause of the issue because the metrics package was using local storage a lot.
To ensure better compatibility with game engines, IndexedDB should be used instead of local storage for storing OIDC data.
Update game bridge (build from ts-immutable-sdk version 1.45.9).
Customer Impact
Switched from localStorage to IndexedDB for storing OIDC data, resolving token persistence issues when reopening games and ensuring more reliable authentication across platforms.