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(context): clear binding cache upon scope/getValue changes #2656

Merged
merged 2 commits into from
Apr 1, 2019

Conversation

raymondfeng
Copy link
Contributor

@raymondfeng raymondfeng commented Mar 28, 2019

Extracted from #2635:

Make sure binding cache is cleared if the binding is bound to a new value provider or scope

  • The binding instance may cache values for contexts based on the scope
  • If an existing binding changes its value provider or scope, the cache should be invalidated.

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

@raymondfeng raymondfeng requested a review from bajtos as a code owner March 28, 2019 14:59
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this smaller pull request ❤️

I ran of time today, I'll review the changes in more detail tomorrow.

packages/context/src/__tests__/unit/binding.unit.ts Outdated Show resolved Hide resolved
packages/context/src/binding.ts Outdated Show resolved Hide resolved
packages/context/src/binding.ts Outdated Show resolved Hide resolved
@raymondfeng raymondfeng requested a review from bajtos March 28, 2019 16:39
@raymondfeng raymondfeng added the IoC/Context @loopback/context: Dependency Injection, Inversion of Control label Mar 28, 2019
packages/context/src/binding.ts Outdated Show resolved Hide resolved
packages/context/src/binding.ts Outdated Show resolved Hide resolved
packages/context/src/binding.ts Outdated Show resolved Hide resolved
packages/context/src/resolution-session.ts Outdated Show resolved Hide resolved
packages/context/src/__tests__/unit/binding.unit.ts Outdated Show resolved Hide resolved
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@raymondfeng raymondfeng merged commit 122fe7b into master Apr 1, 2019
@raymondfeng raymondfeng deleted the fix-binding-cache branch April 1, 2019 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature IoC/Context @loopback/context: Dependency Injection, Inversion of Control
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants