-
Notifications
You must be signed in to change notification settings - Fork 12
Config service improvements #49
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you apply all the config fetching/caching/snapshot-related improvements to the intellisense docs from here?
value: defaultValue, | ||
error: message, | ||
user: user)) | ||
errorCode: .settingValueTypeMismatch, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should return the error code settingValueTypeMismatch
in this case since this is not a type mismatch between the default and evaluated value type. This is a case where user simply called the evaluation function with an invalid parameter.
Other SDKs throw in this case, but from my understanding the Swift SDK doesn't use exceptions. So I think we should use unexpectedError
or probably even introduce a new error code invalidUserInput = -2
or something like that.
@@ -200,7 +200,7 @@ public final class ConfigCatClient: NSObject, ConfigCatClientProtocol { | |||
let evalUser = user ?? defaultUser | |||
|
|||
if let error = flagEvaluator.validateFlagType(of: Value.self, key: key, defaultValue: defaultValue, user: evalUser) { | |||
completion(TypedEvaluationDetails<Value>.fromError(key: key, value: defaultValue, error: error, user: evalUser)) | |||
completion(TypedEvaluationDetails<Value>.fromError(key: key, value: defaultValue, error: error, errorCode: .settingValueTypeMismatch, user: evalUser)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue.
key: key, | ||
value: defaultValue, | ||
error: error, | ||
errorCode: .settingValueTypeMismatch, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue.
Co-authored-by: adams85 <[email protected]>
Yep, I will, and I'll also work on the coverage and duplication situation. |
…igcat/swift-sdk into config-service-improvements
|
Describe the purpose of your pull request
This PR contains the following:
EvaluationDetails
andRefreshResults
.Minor breaking changes
Some components (usually not directly referenced by type) were renamed:
ConfigCatSnapshot
->ConfigCatClientSnapshot
ClientReadyState
->ClientCacheState
Related issues (only if applicable)
Requirement checklist (only if applicable)