Skip to content

Commit

Permalink
fix: testflight bug with version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Dec 11, 2023
1 parent ccd9cb2 commit bcd7308
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.5.1

# Fix:
- Bug where testflight upload would succeed when the app was invalid because of a lower,same version number

# 0.5.0

# Feat:
Expand Down
17 changes: 16 additions & 1 deletion lib/src/integrations/playstore/plugin/playstore_plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import 'package:impaktfull_cli/src/core/util/logger/logger.dart';
import 'package:path/path.dart';

class PlayStorePlugin extends ImpaktfullCliPlugin {
static const _defaultTrack = 'internal';

const PlayStorePlugin({
required super.processRunner,
});
Expand Down Expand Up @@ -42,8 +44,21 @@ class PlayStorePlugin extends ImpaktfullCliPlugin {
packageName,
appEditId,
uploadMedia: Media(file.openRead(), await file.length()),
uploadOptions: UploadOptions(),
);
final trackRelease = TrackRelease(
status: 'draft',
);
await api.edits.tracks.update(
Track(
releases: [
trackRelease,
],
),
packageName,
appEditId,
_defaultTrack,
);

await api.edits.commit(packageName, appEditId);
},
);
Expand Down
4 changes: 4 additions & 0 deletions lib/src/integrations/testflight/plugin/testflight_plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class TestFlightPlugin extends ImpaktfullCliPlugin {
} else if (result.contains('The auth server returned a bad status code.')) {
throw ImpaktfullCliError(
'Error during authentication with appstoreconnect (check email, app-specific password, connection to the internet)');
} else if (result
.contains('Asset validation failed, this bundle is invalid.')) {
throw ImpaktfullCliError(
'The uploaded file is not valid. (Check if version is higher than the previous one)');
} else if (result.contains('ContentDelivery Code=-19232')) {
throw ImpaktfullCliError(
'The bundle version must be higher than the previously uploaded version');
Expand Down

0 comments on commit bcd7308

Please sign in to comment.