Skip to content

Commit 765a921

Browse files
committed
fix: Get fresh ETag for each language update to avoid conflicts
1 parent 836aa5e commit 765a921

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

lib/fastlane/plugin/amazon_appstore/helper/amazon_appstore_helper.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,15 @@ def self.update_listings_for_multiple_apks(app_id:, edit_id:, token:, version_co
189189
end
190190
raise StandardError, listings_response.body unless listings_response.success?
191191

192-
# Use the ETag from the initial request
193-
etag = listings_response.headers['Etag']
194-
195192
# Process each language once
196193
listings_response.body[:listings].each do |lang, listing|
194+
# Get fresh ETag for each language update to avoid conflicts
195+
etag_response = api_client.get(listings_path) do |request|
196+
request.headers['Authorization'] = "Bearer #{token}"
197+
end
198+
raise StandardError, etag_response.body unless etag_response.success?
199+
etag = etag_response.headers['Etag']
200+
197201
# Find the best changelog for multiple version codes
198202
recent_changes = find_changelog_for_multiple_version_codes(
199203
language: listing[:language],

0 commit comments

Comments
 (0)