[eas-cli] Fix metadata:push silently skipping screenshot reorder when set already matches by (filename, fileSize)#3694
Open
Maples7 wants to merge 1 commit into
Conversation
…so reorder is not silently skipped
`AppScreenshotSet.infoAsync` from @expo/apple-utils does not pass an
`includes` query by default, so the App Store Connect API responds without
`relationships.appScreenshots.data` and `attributes.appScreenshots` ends up
undefined. The reorder check below then sees an empty list and silently
skips the PATCH — leaving the live store with a stale order even though
every (filename, fileSize) pair already matches the local config and no
upload was needed.
Pass `query: { includes: [`appScreenshots`] }` explicitly so the refresh
returns the canonical relationship data and reorder runs when needed.
Refs expo#3690.
|
Subscribed to pull request
Generated by CodeMention |
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.
Why
Refs #3690. Closes #3690.
eas metadata:pushcan finish reporting success while App Store Connect still shows screenshots in a different order than the localstore.config.json. This happens when every (filename, fileSize) pair in a screenshot set already matches what's live, so eas-cli skips upload — but the reorder step that should still run is silently a no-op, locking in whatever order ASC currently has (often stale from an earlier transient failure).Root cause
In
packages/eas-cli/src/metadata/apple/tasks/screenshots.ts, after the upload pass, eas-cli refreshes the set to read the live order:AppScreenshotSet.infoAsyncis defined in@expo/apple-utils(≤ 2.1.21) without adefaultQuery, so the underlying request isGET /v1/appScreenshotSets/{id}with no?include=appScreenshots.I verified empirically against a live ASC app:
relationships.appScreenshots.dataGET /v1/appScreenshotSets/{id}(no?include)GET /v1/appScreenshotSets/{id}?include=appScreenshotsGET /v1/appScreenshotSets/{id}/relationships/appScreenshotsThe JSON:API parser in
@expo/apple-utilsskips relationships with nodata:So
refreshedSet.attributes.appScreenshotsends upundefined→refreshedScreenshots = []→screenshotsByFilenameis empty →orderedIdsis empty → theif (orderedIds.length > 0 && …)reorder guard is never satisfied →reorderScreenshotsAsyncis never called → live order stays stale.It's worth noting
AppStoreVersionLocalization.getAppScreenshotSetsAsync(the call eas-cli uses to populate the initialscreenshotSetsmap inprepareAsync) hardcodesincludes: [..., 'appScreenshots'], which is why everything else in this file works. Only the post-upload refresh was affected.How
AppScreenshotSet.infoAsyncacceptsquery?: ConnectQueryParams, so we can compensate from eas-cli without waiting for an@expo/apple-utilsrelease:The longer-term fix is to add
defaultQuery: { includes: ['appScreenshots'] }toAppScreenshotSet.infoAsyncinside@expo/apple-utils(it's already done for similar models likeCustomerReview, which usesDEFAULT_INCLUDES). I'm filing that suggestion separately on #3690 so the maintainers of the package can route it.Test Plan
screenshots.test.ts:AppScreenshotSet.infoAsyncis called withquery: { includes: ['appScreenshots'] },reorderScreenshotsAsyncis called with the desired order.Local results:
yarn build→ green (lerna build for 13 projects).yarn lint→ no new errors (12 pre-existing warnings unrelated to this change).yarn jest --testPathPattern='metadata'→ 191 / 191 passing (16 suites)./changelog-entry bug-fix [eas-cli] Fix
metadata:pushsilently skipping screenshot reorder when every (filename, fileSize) already matches the live set.