Skip to content

Commit

Permalink
Fix API error when trying to reject previous TestFlight build from re…
Browse files Browse the repository at this point in the history
…view

Applying the fix from #18408

-mKudos to @nid90 for the fix
  • Loading branch information
AliSoftware committed Apr 30, 2024
1 parent df12128 commit 1e79181
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pilot/lib/pilot/build_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,17 @@ def should_update_localized_build_information?(options)
end

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

Expand Down

0 comments on commit 1e79181

Please sign in to comment.