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

Remove the containsValue(forKey:) method from feature-flag stores #140

Closed
yakovmanshin opened this issue May 10, 2024 · 0 comments · Fixed by #141
Closed

Remove the containsValue(forKey:) method from feature-flag stores #140

yakovmanshin opened this issue May 10, 2024 · 0 comments · Fixed by #141
Assignees
Labels
breaking This issue breaks compatibility with previous versions optimization Code optimizations for improved performance
Milestone

Comments

@yakovmanshin
Copy link
Owner

  • Inconsistent return values between containsValue(forKey:) and value(forKey:) can result in unexpected behavior
  • The removal of containsValue(forKey:) was expected in Support error throwing in feature-flag stores #132 / [#132] Error Throwing in Feature-Flag Stores #139 but didn’t arrive there because it would require more changes than anticipated: FeatureFlagResolver needs a way to distinguish between missing values (in that case it polls the next feature-flag store) and another error (in that case the resolver rethrows the error)
@yakovmanshin yakovmanshin added optimization Code optimizations for improved performance breaking This issue breaks compatibility with previous versions labels May 10, 2024
@yakovmanshin yakovmanshin added this to the v4.0.0 milestone May 10, 2024
@yakovmanshin yakovmanshin self-assigned this May 10, 2024
yakovmanshin added a commit that referenced this issue May 11, 2024
* Removed the `containsValue(forKey:` method from protocols for feature-flag stores to prevent conflicts between this method and `value(forKey:)`
* Introduced `FeatureFlagStoreError` which contains two predefined error cases: `valueNotFound` and `typeMismatch`; `valueNotFound` is especially important as it determines the behavior of `FeatureFlagResolver`
* Updated the `value(forKey:)` methods’ return type to `Result<Value, FeatureFlagStoreError>`
* Updated `FeatureFlagResolver`
* Updated the built-in stores
* Removed `CommonFeatureFlagStoreError`
* Updated tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This issue breaks compatibility with previous versions optimization Code optimizations for improved performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant