Skip to content

Commit fc8b057

Browse files
authored
Increase the accepted uncompressed total size of an uploaded archive to 256 MiB. (#9085)
1 parent 062e63a commit fc8b057

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Important changes to data models, configuration, and migrations between each
22
AppEngine version, listed here to ease deployment and troubleshooting.
33

44
## Next Release (replace with git tag when deployed)
5+
* Note: accepted uncompressed archive total size is increased to 256 MiB.
56

67
## `20251120t084200-all`
78
* Bump runtimeVersion to `2025.11.18`.

pkg/pub_package_reader/lib/pub_package_reader.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ Future<PackageSummary> summarizePackageArchive(
7777
/// The maximum length of the extracted content text.
7878
int maxContentLength = 256 * 1024,
7979

80-
/// The maximum file size of the archive (gzipped or compressed) and
81-
/// the maximum total size of the files inside the archive.
80+
/// The maximum file size of the archive (compressed).
8281
int maxArchiveSize = 100 * 1024 * 1024,
8382

83+
/// The maximum total size of the files inside the archive.
84+
int maxUncompressedSize = 256 * 1024 * 1024,
85+
8486
/// The maximum number of files in the archive.
8587
/// TODO: set this lower once we scan the existing archives
8688
int maxFileCount = 64 * 1024,
@@ -102,6 +104,7 @@ Future<PackageSummary> summarizePackageArchive(
102104
await scanArchiveSurface(
103105
archivePath,
104106
maxArchiveSize: maxArchiveSize,
107+
maxUncompressedSize: maxUncompressedSize,
105108
).toList(),
106109
);
107110
if (issues.isNotEmpty) {

pkg/pub_package_reader/lib/src/archive_surface.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'package:pub_package_reader/pub_package_reader.dart' show ArchiveIssue;
1313
Stream<ArchiveIssue> scanArchiveSurface(
1414
String archivePath, {
1515
required int maxArchiveSize,
16+
required int maxUncompressedSize,
1617
}) async* {
1718
// Some platforms may not be able to create an archive, only an empty file.
1819
final file = File(archivePath);
@@ -43,9 +44,9 @@ Stream<ArchiveIssue> scanArchiveSurface(
4344
if (uncompressedLength <= 0) {
4445
yield ArchiveIssue('Uncompressed archive is empty (size = 0).');
4546
return;
46-
} else if (uncompressedLength > maxArchiveSize) {
47+
} else if (uncompressedLength > maxUncompressedSize) {
4748
yield ArchiveIssue(
48-
'Uncompressed package archive is too large (size > $maxArchiveSize).',
49+
'Uncompressed package archive is too large (size > $maxUncompressedSize).',
4950
);
5051
return;
5152
}

pkg/pub_package_reader/test/archive_surface_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void main() {
8484

8585
final summary = await summarizePackageArchive(
8686
archiveFile.path,
87-
maxArchiveSize: 199999,
87+
maxUncompressedSize: 199999,
8888
);
8989
expect(summary.issues, isNotEmpty);
9090
expect(

0 commit comments

Comments
 (0)