fix(@expo/apple-utils): patch getNextUrl() to fix pagination cookie domain mismatch (#3392)#3533
Closed
adityapsbisht wants to merge 2 commits intoexpo:mainfrom
Closed
Conversation
…on domain Applies a postinstall fix for the cookie domain mismatch in @expo/apple-utils v2.1.13 that causes `Cookie not in this host's domain` errors during iOS builds. Root cause: Apple's paginated API responses include `links.next` with absolute URLs like `https://developer.apple.com/services-account/v1/...`. In ConnectResponse.fetchNextPageAsync(), these absolute URLs are passed directly to axios. Because the URL is absolute, axios ignores the configured baseURL (https://developer-mdn.apple.com), so the request hits developer.apple.com. tough-cookie then rejects the session cookies (set for developer-mdn.apple.com) causing the build to fail at capability/profile sync. Fix: Normalize pagination URLs to relative paths (strip domain, keep path + query) so axios always resolves them against the correct baseURL. TypeScript source change needed in @expo/apple-utils: // Before getNextUrl(): string | null { return this.data?.links?.next ?? null; } // After getNextUrl(): string | null { const next = this.data?.links?.next ?? null; if (!next) return null; try { const parsed = new URL(next); return parsed.pathname + parsed.search; } catch { return next; } } The postinstall script applies this fix to the compiled build/index.js until @expo/apple-utils publishes a version with the fix included. Closes expo#3392 Made-with: Cursor
|
Subscribed to pull request
Generated by CodeMention |
- Run oxfmt to fix formatting issues in patch-apple-utils-pagination.js - Add CHANGELOG entry under ## main > Bug fixes Made-with: Cursor
Member
|
hey @adityapsbisht , thanks for putting up a fix! i've gone ahead and ported your fix to our internal apple-utils repo so we dont need to have a postinstall script to modify the minified code :) in the meantime, i'll leave this pr open until we've merged the changes upstream and bumped the deps! |
Member
|
landed #3545 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
Cookie not in this host's domain. Cookie:developer-mdn.apple.com Request:developer.apple.comerror that causes iOS builds to fail at the capability/provisioning profile sync step.Closes #3392
Root Cause
Apple's paginated API responses include
links.nextwith absolute URLs likehttps://developer.apple.com/services-account/v1/....In
ConnectResponse.fetchNextPageAsync()inside@expo/apple-utils, these absolute URLs are passed directly to axios. When an axios request URL is already absolute, axios ignores the configuredbaseURL(https://developer-mdn.apple.com). The request hitsdeveloper.apple.cominstead, andtough-cookiecorrectly rejects thedeveloper-mdn.apple.comsession cookies for that domain → build fails.TypeScript Fix Needed in
@expo/apple-utilsThis PR
Since
@expo/apple-utilssource is not in this repo, this PR adds apostinstallscript (scripts/patch-apple-utils-pagination.js) that applies the same fix to the compiledbuild/index.jsafter install.The script:
Remove this script once
@expo/apple-utilspublishes a version containing the fix.Verification
Fix confirmed working by community members in #3392 (reported Feb 2026, confirmed Mar 17 2026).
Error before fix:
After fix: capability sync and provisioning profile steps complete successfully.
Made with Cursor