-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Disable deprecation warning #6512
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
@@ -166,7 +166,11 @@ - (void)runLegacyMigration:(FRepoInfo *)info { | |||
// it'll go fine :P | |||
[writes enumerateKeysAndValuesAsData:^(NSString *key, NSData *data, | |||
BOOL *stop) { | |||
#pragma clang diagnostic push | |||
#pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||
// Update the deprecated API when minimum iOS version is 11+. | |||
id pendingPut = [NSKeyedUnarchiver unarchiveObjectWithData:data]; |
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 it's a great idea to silence this particular deprecation warning. I would go with it only if refactoring to use GULSecureCoding is too complicated.
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.
Good point, but I'm not sure it's worth the time to update and test this rarely executed code. @schmidt-sebastian any thoughts?
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.
Is the concern that we need to specify a class type (which would be FPendingPut)?
linkedin/cassette#18 has a wrapper that uses slightly different APIs that allows to drop usage of this method while continuing to use untyped types.
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.
@maksymmalyhin Correct me if I'm wrong, but my understanding of the concern is using the old unarchive API that doesn't check for NSError's. And GULSecureCoding wraps up the pre and post iOS 11 API nicely.
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.
Paul, there are two concerns here - the one you described and using NSCoding
instead of NSSecureCoding
which implies the concern mentioned by Sebastian. So ideal fix will be updating FPendingPut
and related classes to adopt NSSecureCoding
and use GULSecureCoding
to avoid code duplication related to deprecated methods and error handling.
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.
None of the unit or integration tests exercise this line of code, so I'm hesitant to do more than add the pragma clang diagnostic ignored
.
Thank you!! @paulb777 |
Fix #6502