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(language-service): Invalidate Reflector caches when program changes #32357

Closed

Conversation

@kyliau
Copy link
Member

commented Aug 27, 2019

This commit fixes a bug introduced in the recent refactoring whereby
caches become stale when the program changes.
This is because StaticReflector keeps its own caches that are not
clearable. The previous refactoring tried to reuse the same instance,
leading to out-of-sync program state.

Clearing out the entire cache is very inefficient. Instead, we could
just invalidate the symbols in the files that have changed. This
requires changes to the API of StaticReflector, but put this on hold
until the refactoring of language service for Ivy commences.

PR closes #32301

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

fix(language-service): Invalidate Reflector caches when program changes
This commit fixes a bug introduced in the recent refactoring whereby
caches become stale when the program changes.
This is because StaticReflector keeps its own caches that are not
clearable. The previous refactoring tried to reuse the same instance,
leading to out-of-sync program state.

Clearing out the *entire* cache is very inefficient. Instead, we could
just invalidate the symbols in the files that have changed. This
requires changes to the API of StaticReflector, but put this on hold
until the refactoring of language service for Ivy commences.

PR closes #32301

@kyliau kyliau requested a review from ayazhafiz Aug 27, 2019

@kyliau kyliau requested a review from angular/tools-language-service as a code owner Aug 27, 2019

@ngbot ngbot bot modified the milestone: needsTriage Aug 27, 2019

@googlebot googlebot added the cla: yes label Aug 27, 2019

@kyliau

This comment has been minimized.

Copy link
Member Author

commented Aug 28, 2019

caretaker: PR has been approved and I'm owner of language-service, but it still says pending reviewer.

@mhevery mhevery closed this in 97fc45f Aug 29, 2019

@kyliau kyliau deleted the kyliau:invalidate_metadata_resolver_cache branch Aug 29, 2019

sabeersulaiman added a commit to sabeersulaiman/angular that referenced this pull request Sep 6, 2019
fix(language-service): Invalidate Reflector caches when program chang…
…es (angular#32357)

This commit fixes a bug introduced in the recent refactoring whereby
caches become stale when the program changes.
This is because StaticReflector keeps its own caches that are not
clearable. The previous refactoring tried to reuse the same instance,
leading to out-of-sync program state.

Clearing out the *entire* cache is very inefficient. Instead, we could
just invalidate the symbols in the files that have changed. This
requires changes to the API of StaticReflector, but put this on hold
until the refactoring of language service for Ivy commences.

PR closes angular#32301

PR Close angular#32357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.