-
Notifications
You must be signed in to change notification settings - Fork 227
fix(Amplify): remove a warn level log from CodingKey #957
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #957 +/- ##
=======================================
Coverage 70.39% 70.40%
=======================================
Files 920 920
Lines 39049 39048 -1
=======================================
Hits 27490 27490
+ Misses 11559 11558 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
|
||
| var columnName: String { | ||
| guard let modelSchema: ModelSchema = ModelRegistry.modelSchema(from: modelName) else { | ||
| log.warn("Please upgrade to the latest version of Amplify CLI and rerun `amplify codegen models`") |
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.
Why is removing the message the right thing here? What should a customer do to fix this if not upgrade & regen models?
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.
The message is printed out too often even you don't explicitly call DataStore.query().
For example:
During Amplify.DataStore.start(), clearStateOutgoingMutations will be called, it creates a predicate which accesses columnName, but MutationEvent is not in ModelRegistry so that it fails the guard comment and print out the warning message.
func clearStateOutgoingMutations(completion: @escaping BasicClosure) {
let fields = MutationEvent.keys
let predicate = fields.inProcess == true
let sort = QuerySortDescriptor(fieldName: fields.createdAt.stringValue, order: .ascending)
storageAdapter.query(MutationEvent.self,
predicate: predicate,
sort: [sort],
paginationInput: nil) { result in
switch result {
case .failure(let dataStoreError):
log.error("Failed on clearStateOutgoingMutations: \(dataStoreError)")
case .success(let mutationEvents):
if !mutationEvents.isEmpty {
updateMutationsState(mutationEvents: mutationEvents,
completion: completion)
} else {
completion()
}
}
}
}But like you said, the removal of message won't tell customer the fix unless they create a Github issue and we reply to tell them.
|
Closing because of a PR reverting the change: #963 |
Issue #, if available:
Description of changes:
the log is printed out too often even
queryis not calledBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.