-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[spaceship] Handle "Apple ID is locked" and other authentication errors better #14387
base: master
Are you sure you want to change the base?
Conversation
Apple id returning different status and messages when the Apple ID is not "alright". We should better handle the cases, so spaceship does not break.
What does this refer to? The code you posted looks like part of a cookie!? |
Looks like there’s a linter error |
Not sure how to fix this, because it never got touched:
|
else | ||
raise InvalidUserCredentialsError.new, "Login worked, but Apple reported that something was wrong anyway. Historically this has happened when an Apple ID got lost on Apple's end. See https://github.com/fastlane/fastlane/issues/14398" | ||
case response.body["serviceErrors"][0]["code"] | ||
when "-20209" |
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.
Can we add a comment with the full response body here (and for all other error cases) for reference?
(Or as fixtures for a corresponding test?)
@max-ott Perceived complexity for send_shared_login_request is too high means (roughly) that there's too many conditionals in 1 method, and you can usually fix it by extracting some logic to a separate method |
No idea how to do that. Any help appreciated. |
This are the docs of the cop: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Metrics/PerceivedComplexity |
Apple id returning different status and messages when the Apple ID is not "alright". We should better handle the cases, so spaceship does not break.
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validCase: wrong password
Case: account locked by Apple
Case: Apple ID messed up by Apple (currently in process with dev support)
Need help with:
It's probably possible to have the error handling in a nicer way. With my quick fix I get the following messages: