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

Update the immersive reader token #9952

Merged
merged 5 commits into from
Apr 10, 2024
Merged

Update the immersive reader token #9952

merged 5 commits into from
Apr 10, 2024

Conversation

aznhassan
Copy link
Contributor

Problem

A change went live that returned Immersive Reader tokens with invalid expiration dates. Those tokens will effectively never expire; this becomes a problem since we do not remove invalid tokens. Meaning anyone who received the bad token is stuck unless they manually remove the token from local storage themselves.

Solution

Change the name of the Immersive Reader token so that those with a broken token will pick up a new one. Then make sure to remove the Immersive Reader token if there is a problem using it. That way if something like this happens again, we do not have to worry about old tokens sticking around.

Validation

See Arcade build using these changes.

  • Using the above build navigate to the home page and click on the first tutorial. Click on the Immersive Reader button and confirm it works as expected.
  • Exit the immersive reader and load the debugger. Set a breakpoint right after await getTokenAsync(); in launchImmersiveReaderAsync. Run the immersive reader again, set the token to gibberish. Confirm that the token is present in local storage. Continue the function, click okay on the Immersive Reader error modal. Confirm that the token has been removed from local storage.

Notes

This partially addresses microsoft/pxt-microbit#5574, though not until this change is served can we call it closed.

@aznhassan aznhassan requested a review from a team April 8, 2024 22:58
@aznhassan aznhassan self-assigned this Apr 8, 2024
@aznhassan aznhassan merged commit 3979157 into master Apr 10, 2024
6 checks passed
@aznhassan aznhassan deleted the aznhassan/immreader branch April 10, 2024 22:14
aznhassan added a commit that referenced this pull request Apr 10, 2024
* Update the immersive reader token

* Change launchImmersiveReader to async/await

* Change missed promise to async/await

* Remove the token if there is a problem using it

* Await calls to `launchImmersiveReaderAsync`.
aznhassan added a commit that referenced this pull request Apr 10, 2024
* Update the immersive reader token

* Change launchImmersiveReader to async/await

* Change missed promise to async/await

* Remove the token if there is a problem using it

* Await calls to `launchImmersiveReaderAsync`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants