-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(appstore-connect): Add a new endpoint that returns the status of all configured apps [NATIVE-294] #29728
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
30b4997
fix(appstore-connect): Add a new endpoint that returns the status of …
relaxolotl a4b3a5e
return a list of statuses for every config associated with a project
relaxolotl 7d9492b
frontend support for multiple statuses being returned
relaxolotl 9bd72a0
complete backend implementation
relaxolotl bb58318
full frontend support for new status endpoint
relaxolotl 1027735
no need to instantiate
relaxolotl 058d684
this was test code oops
relaxolotl e008a26
return a map instead of a list
relaxolotl f5c4832
scope list of pending downloads to a specific app/config
relaxolotl 85b2b9d
s/appstoreconnectvalidationdata/appstoreconnectstatusdata/
relaxolotl da31f16
add trailing slash
relaxolotl 8473a41
address feedback
relaxolotl d8e494e
remove nested ID in payload
relaxolotl cc96284
just directly check for validity
relaxolotl 1e7fa19
fix endpoint
relaxolotl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,13 +28,17 @@ const fieldErrorMessageMapping = { | |
| }, | ||
| }; | ||
|
|
||
| type ErrorCodeDetailed = | ||
| export type ErrorCodeDetailed = | ||
| | 'app-connect-authentication-error' | ||
| | 'app-connect-forbidden-error' | ||
| | 'app-connect-multiple-sources-error'; | ||
|
|
||
| export type ValidationErrorDetailed = { | ||
| code: ErrorCodeDetailed; | ||
| }; | ||
|
|
||
| type ResponseJSONDetailed = { | ||
| detail: { | ||
| code: ErrorCodeDetailed; | ||
| detail: ValidationErrorDetailed & { | ||
| extra: Record<string, any>; | ||
| message: string; | ||
| }; | ||
|
|
@@ -64,21 +68,7 @@ export function getAppStoreErrorMessage( | |
| ?.detail; | ||
|
|
||
| if (detailedErrorResponse) { | ||
| switch (detailedErrorResponse.code) { | ||
| case 'app-connect-authentication-error': | ||
| return t( | ||
| 'We could not establish a connection with App Store Connect. Please check the entered App Store Connect credentials' | ||
| ); | ||
| case 'app-connect-multiple-sources-error': | ||
| return t( | ||
| 'Only one Apple App Store Connect application is allowed in this project' | ||
| ); | ||
| default: { | ||
| // this shall not happen | ||
| Sentry.captureException(new Error('Unknown app store connect error')); | ||
| return unexpectedErrorMessage; | ||
| } | ||
| } | ||
| return getAppStoreValidationErrorMessage(detailedErrorResponse); | ||
| } | ||
|
|
||
| const errorResponse = error.responseJSON as undefined | ResponseJSON; | ||
|
|
@@ -116,3 +106,23 @@ export function getAppStoreErrorMessage( | |
| {} | ||
| ) as Record<keyof StepOneData, string>; | ||
| } | ||
|
|
||
| export function getAppStoreValidationErrorMessage( | ||
| error: ValidationErrorDetailed | ||
| ): string { | ||
| switch (error.code) { | ||
| case 'app-connect-authentication-error': | ||
| return t( | ||
| 'Credentials are invalid or missing. Check the entered App Store Connect credentials are correct.' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. <3 |
||
| ); | ||
| case 'app-connect-forbidden-error': | ||
| return t('The supplied API key does not have sufficient permissions.'); | ||
| case 'app-connect-multiple-sources-error': | ||
| return t('Only one Apple App Store Connect application is allowed in this project'); | ||
| default: { | ||
| // this shall not happen | ||
| Sentry.captureException(new Error('Unknown app store connect error')); | ||
| return unexpectedErrorMessage; | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.