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
Keep File Manager from Error State on disallowed #1455
Keep File Manager from Error State on disallowed #1455
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.
Please add unit tests to the ListFilesOperationSpec and the FileManager spec to account for this case.
Co-Authored-By: Joel Fischer <joeljfischer@gmail.com>
@@ -157,6 +157,22 @@ @implementation FileManagerSpecHelper | |||
}); | |||
}); | |||
|
|||
describe(@"after receiving a ListFiles error with a resulCode", ^{ |
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.
describe(@"after receiving a ListFiles error with a resulCode", ^{ | |
describe(@"after receiving a ListFiles error with a resultCode DISALLOWED", ^{ |
@@ -59,7 +59,14 @@ - (void)sdl_listFiles { | |||
NSUInteger bytesAvailable = listFilesResponse.spaceAvailable != nil ? listFilesResponse.spaceAvailable.unsignedIntegerValue : 2000000000; | |||
|
|||
if (weakSelf.completionHandler != nil) { | |||
weakSelf.completionHandler(success, bytesAvailable, fileNames, error); | |||
if([response.resultCode isEqualToEnum:SDLResultDisallowed]) { |
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.
Instead of this, just always set the resultCode
into the error if an error exists.
expect(@(successResult)).to(equal(@NO)); | ||
}); | ||
|
||
it(@"should have called completion handler with error including a resultCode ", ^{ |
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.
Based on the above change request, I think that this it
is the only one needed?
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.
Just two very minor comment changes
Co-Authored-By: Joel Fischer <joeljfischer@gmail.com>
Fixes #1454
This PR is ready for review.
Risk
This PR makes no API changes.
Testing Plan
Test against example app using Xcode 11. Make sure to remove
ListFiles
RPC from cores policy table in order to recreate adisallowed
Summary
This PR adds a check to see if the error was
disallowed
. If it isdisallowed
we no longer want to Error but rather continue with the setup process.CLA