Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the single account cache before notifying the caller of account change/load via callback. #1688

Merged
merged 4 commits into from
Aug 29, 2022

Conversation

iamgusain
Copy link
Contributor

@iamgusain iamgusain commented Aug 24, 2022

What

Updating the single account cache before notifying the caller of account change/load via callback.

Why

We should update the single account cache, before calling the call back, as we don't own the callback code so it might fail/throw, which might result in we not able to update the cache. Another example is if the callback executes some code that assuming the current account has been updated, that might fail. So, it is best to first update the cache and then notify the caller via callbacks in the end.

How

Moving the code to persist current account to cache before the notification via callback to the caller

Testing

Verified using Azure Sample app locally by mimicking both cases as described in the why section.

@github-actions github-actions bot added the msal label Aug 24, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2022

Codecov Report

Merging #1688 (fb72156) into dev (2af3d0b) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##                dev    #1688   +/-   ##
=========================================
  Coverage     49.48%   49.48%           
  Complexity      373      373           
=========================================
  Files            59       59           
  Lines          2708     2708           
  Branches        333      332    -1     
=========================================
  Hits           1340     1340           
  Misses         1224     1224           
  Partials        144      144           
Impacted Files Coverage Δ
...y/client/SingleAccountPublicClientApplication.java 73.56% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@iamgusain iamgusain marked this pull request as ready for review August 26, 2022 22:49
@iamgusain iamgusain requested a review from a team as a code owner August 26, 2022 22:49
@iamgusain iamgusain merged commit 4290fc3 into dev Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants