Resolve environments using cache if cache has complete info - #17474
Merged
Conversation
…ther there is a refresh going on
Kartik Raj (karrtikr)
requested a review
from Kim-Adeline Miguel (kimadeline)
September 21, 2021 00:30
Kim-Adeline Miguel (kimadeline)
left a comment
There was a problem hiding this comment.
I understand the changes, but I don't understand the motivation behind it. Why aren't we using partial env info anymore?
Author
Earlier we were relying on the fact whether a refresh is going on to see whether a cache has partial info, this check is more accurate. |
| // Envs in cache may have incomplete info when a refresh is happening, so | ||
| // do not rely on cache in those cases. | ||
| if (cachedEnv && this.refreshPromises.size === 0) { | ||
| if (cachedEnv) { |
There was a problem hiding this comment.
Now that 3rd party extensions can also trigger a refresh, refresh can be going on any moment, we want to ensure we still use the cache in that case.
Kim-Adeline Miguel (kimadeline)
approved these changes
Sep 21, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Even if there is a refresh going on, we can rely on the cache if it has complete info.