Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

AccountManager: write user ID synchronously, keep it in memory. #145

Merged
merged 2 commits into from
Jan 15, 2020

Conversation

tarigo
Copy link
Contributor

@tarigo tarigo commented Jan 14, 2020

  • write user ID synchronously in order to avoid potential side effects (use commit() instead of apply());
  • cache userId (as class member); if it fails to save shared preferences (insufficient storage error or whatever), at least we have app life-time user ID;
  • getSkuToken() is used from different thread (by http stack), so lets move all interaction with user id property to synchronized method;

@tarigo tarigo requested a review from tobrun January 14, 2020 15:32
@tarigo tarigo self-assigned this Jan 14, 2020
@tarigo tarigo marked this pull request as ready for review January 14, 2020 18:34
Copy link
Contributor

@langsmith langsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@tarigo tarigo merged commit ef4c225 into master Jan 15, 2020
tobrun pushed a commit that referenced this pull request Jan 22, 2020
* AccountManager: write user ID synchronously, keep it in memory.
* Unit tests: run AccountsManagerTest with Robolectric.
tobrun pushed a commit that referenced this pull request Jan 22, 2020
* AccountManager: write user ID synchronously, keep it in memory.
* Unit tests: run AccountsManagerTest with Robolectric.
tobrun pushed a commit that referenced this pull request Jan 22, 2020
* AccountManager: write user ID synchronously, keep it in memory.
* Unit tests: run AccountsManagerTest with Robolectric.
@tarigo tarigo deleted the tarigo_sku_user_id_fix branch March 25, 2020 13:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants