xcodes
xcodes copied to clipboard
Improve error message if user signs in with Apple ID that isn't a developer
Not sure of the details of this yet, but had a user that was running xcodes update, signing in successfully, then got this error output:
The operation couldn't be completed. (DecodingError.keyNotFound(CodingKeys(stringValue: "downloads", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"downloads\", intValue: nil) (\"downloads\").", underlyingError: nil)))
The error message seems to indicate that parsing the downloads JSON failed because the session was invalid.
It turns out their Apple ID wasn't a developer account. Need to investigate if this means "doesn't have a valid ADC membership" or something else.
@interstateone I believe this happens too when you type in the 2FA code wrong. Just got
The operation couldn’t be completed. (DecodingError.keyNotFound(CodingKeys(stringValue: "downloads", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"downloads\", intValue: nil) (\"downloads\").", underlyingError: nil)))
Interesting, I thought that was already handled better. Thanks for calling it out, could you open a new issue to track it?
Confirmed the response with a new test Apple ID. Fetching the seedlist with a user that isn't registered as a developer returns:
HTTP/1.1 200 OK
Server: Apple
Date: Thu, 01 Oct 2020 03:02:39 GMT
Content-Type: text/plain;charset=iso-8859-1
Content-Length: 127
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-XSS-Protection: 1; mode=block
Host: developer.apple.com
X-Frame-Options: SAMEORIGIN
rqId: 13024554367ea1b57bc6850125677e25
Age: 0
Via: https/1.1 usscz2-edge-lx-008.ts.apple.com (ApacheTrafficServer/8.1.0), https/1.1 usscz2-edge-bx-005.ts.apple.com (ApacheTrafficServer/8.1.0)
CDNUUID: 8e2ac702-18c9-4aaf-94a3-cc0253b9c5a4-586545440
X-Cache: miss, miss
Connection: close
{
"responseId": "55e8d7fc-3e14-401f-bdf1-db96649fe523",
"resultCode": 2100,
"resultString": "You are not registered as an Apple Developer. Please visit Apple Developer Registration. https://developer.apple.com/register/",
"userString": "You are not registered as an Apple Developer. Please visit Apple Developer Registration. https://developer.apple.com/register/",
"creationTimestamp": "2020-10-01T03:23:00Z",
"protocolVersion": "QH65B2",
"userLocale": "en_US",
"requestUrl": "https://developer.apple.com/services-account/QH65B2/downloadws/listDownloads.action",
"httpCode": 200
}
We should print out the response body in this case.
closing as of 1.0 we now no longer require apple accounts to download xcode