Skip to content

Commit 806c80c

Browse files
authored
Fix API error when trying to reject previous TestFlight build from review (fastlane#21995)
Fix fastlane#18408 Applying the fix from fastlane#18408 (comment) Kudos to @nid90 for the fix
1 parent e8fe2a9 commit 806c80c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

pilot/lib/pilot/build_manager.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,17 @@ def should_update_localized_build_information?(options)
368368
end
369369

370370
def reject_build_waiting_for_review(build)
371-
waiting_for_review_build = build.app.get_builds(filter: { "betaAppReviewSubmission.betaReviewState" => "WAITING_FOR_REVIEW" }, includes: "betaAppReviewSubmission,preReleaseVersion").first
371+
waiting_for_review_build = build.app.get_builds(
372+
filter: { "betaAppReviewSubmission.betaReviewState" => "WAITING_FOR_REVIEW,IN_REVIEW",
373+
"expired" => false,
374+
"preReleaseVersion.version" => build.pre_release_version.version },
375+
includes: "betaAppReviewSubmission,preReleaseVersion"
376+
).first
372377
unless waiting_for_review_build.nil?
373378
UI.important("Another build is already in review. Going to remove that build and submit the new one.")
374-
UI.important("Deleting beta app review submission for build: #{waiting_for_review_build.app_version} - #{waiting_for_review_build.version}")
375-
waiting_for_review_build.beta_app_review_submission.delete!
376-
UI.success("Deleted beta app review submission for previous build: #{waiting_for_review_build.app_version} - #{waiting_for_review_build.version}")
379+
UI.important("Canceling beta app review submission for build: #{waiting_for_review_build.app_version} - #{waiting_for_review_build.version}")
380+
waiting_for_review_build.expire!
381+
UI.success("Canceled beta app review submission for previous build: #{waiting_for_review_build.app_version} - #{waiting_for_review_build.version}")
377382
end
378383
end
379384

0 commit comments

Comments
 (0)