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

fix(AppCheck): Fixed getToken promise not being cleared #6735

Closed

Conversation

ishowta
Copy link

@ishowta ishowta commented Oct 28, 2022

Fix #6734

Immutable assignment by setState failed to clear the exchangeTokenPromise by assigning undefined to it.

state.exchangeTokenPromise = undefined;

There may be a better way, but I wrapped the exchangeTokenPromise in an object to prevent it from deep copy due to spread assignments.

@ishowta ishowta requested a review from hsubox76 as a code owner October 28, 2022 13:16
@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2022

⚠️ No Changeset found

Latest commit: 1496461

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-cla
Copy link

google-cla bot commented Oct 28, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@hsubox76
Copy link
Contributor

Just wanted to double check, were you able to put this code into the buggy app and observe that it fixed the bug you were seeing?

@ishowta
Copy link
Author

ishowta commented Oct 31, 2022

I'm sorry, but we do not do that.

@hsubox76
Copy link
Contributor

So thanks for pointing out that state setting is inconsistently done in this codebase, I've decided to do a more systematic fix of it with #6740 since I think it would be a bad idea to mix in more mutation. I added your tests into that PR and it passes, so if the test is a good replication of your situation it should fix the bug. Feel free to take a look at that PR and let me know what you think.

@ishowta ishowta closed this Nov 3, 2022
@firebase firebase locked and limited conversation to collaborators Dec 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants