Skip to content

Report the HTTP status when a GrandSlam response is not a plist - #56

Open
izaankml wants to merge 1 commit into
rileytestut:notarizedfrom
izaankml:fix/report-http-status-on-non-plist
Open

izaankml wants to merge 1 commit into
rileytestut:notarizedfrom
izaankml:fix/report-http-status-on-non-plist

Conversation

@izaankml

@izaankml izaankml commented Sep 14, 2026

Copy link
Copy Markdown

Problem

When Apple rate limits sign-in, GrandSlam answers with an HTTP 429 HTML page. The status is below 500, so it passes the 5xx check and reaches the plist parser, and the user sees "The data couldn't be read because it isn't in the correct format" (NSCocoaErrorDomain 3840, unknown tag html). Any other non-5xx HTML response fails the same way. This is easy to hit with AltStore Classic, which signs in once per app on individual refreshes.

Fix

GrandSlam reports its own errors inside the plist, so the HTTP status only matters when the body is not a plist. Parse first, and when that fails throw an ALTAppleAPIError.unknown carrying the HTTP status and the parse error, with a rate-limit message for 429 and the existing "returned an error (HTTP n)" message for everything else. This replaces the separate 5xx checks in the sign-in and trusted-device 2FA handlers with one helper, so every HTML response is reported the same way.

Testing

An earlier revision of this change was built into AltStore Classic on iOS. After several sign-ins within a minute, GrandSlam returned HTTP 429 and the AltStore error log showed "Apple's servers returned an unexpected response (HTTP 429)" instead of the parse error. Sign-in succeeded on retry after waiting. The final revision builds with the AltSign-Static scheme on macOS.

Related: #48, altstoreio/AltStore#1776

GrandSlam reports its own errors inside the plist, so the HTTP status only
matters when the body is not one. Parse first and, when that fails, throw an
ALTAppleAPIError carrying the status, with a specific message for a 429 rate
limit. This replaces the separate 5xx checks in the sign-in and 2FA verify
handlers, which let a 429 HTML page reach the parser and surface as
NSCocoaErrorDomain 3840.
@izaankml
izaankml force-pushed the fix/report-http-status-on-non-plist branch from ee97d65 to 12b361b Compare September 14, 2026 20:45
izaankml added a commit to izaankml/AltStore that referenced this pull request Sep 14, 2026
Points the submodule at izaankml/AltSign classic-build: upstream notarized plus the Xcode 27 linking fix, the HTTP status reporting from rileytestut/AltSign#56, and the developer-services transport change. Build branch only; never carry this commit into a PR.
izaankml added a commit to izaankml/AltStore that referenced this pull request Sep 14, 2026
Points the submodule at izaankml/AltSign classic-build: upstream notarized plus the Xcode 27 linking fix and the HTTP status reporting from rileytestut/AltSign#56. Build branch only; never carry this commit into a PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant