diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e820d45b..0062161b4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Important changes to data models, configuration, and migrations between each AppEngine version, listed here to ease deployment and troubleshooting. ## Next Release (replace with git tag when deployed) + * Note: accepted uncompressed archive total size is increased to 256 MiB. ## `20251120t084200-all` * Bump runtimeVersion to `2025.11.18`. diff --git a/pkg/pub_package_reader/lib/pub_package_reader.dart b/pkg/pub_package_reader/lib/pub_package_reader.dart index 15151fcb26..1321e3075f 100644 --- a/pkg/pub_package_reader/lib/pub_package_reader.dart +++ b/pkg/pub_package_reader/lib/pub_package_reader.dart @@ -77,10 +77,12 @@ Future summarizePackageArchive( /// The maximum length of the extracted content text. int maxContentLength = 256 * 1024, - /// The maximum file size of the archive (gzipped or compressed) and - /// the maximum total size of the files inside the archive. + /// The maximum file size of the archive (compressed). int maxArchiveSize = 100 * 1024 * 1024, + /// The maximum total size of the files inside the archive. + int maxUncompressedSize = 256 * 1024 * 1024, + /// The maximum number of files in the archive. /// TODO: set this lower once we scan the existing archives int maxFileCount = 64 * 1024, @@ -102,6 +104,7 @@ Future summarizePackageArchive( await scanArchiveSurface( archivePath, maxArchiveSize: maxArchiveSize, + maxUncompressedSize: maxUncompressedSize, ).toList(), ); if (issues.isNotEmpty) { diff --git a/pkg/pub_package_reader/lib/src/archive_surface.dart b/pkg/pub_package_reader/lib/src/archive_surface.dart index c3eabc6a48..aa88a3be34 100644 --- a/pkg/pub_package_reader/lib/src/archive_surface.dart +++ b/pkg/pub_package_reader/lib/src/archive_surface.dart @@ -13,6 +13,7 @@ import 'package:pub_package_reader/pub_package_reader.dart' show ArchiveIssue; Stream scanArchiveSurface( String archivePath, { required int maxArchiveSize, + required int maxUncompressedSize, }) async* { // Some platforms may not be able to create an archive, only an empty file. final file = File(archivePath); @@ -43,9 +44,9 @@ Stream scanArchiveSurface( if (uncompressedLength <= 0) { yield ArchiveIssue('Uncompressed archive is empty (size = 0).'); return; - } else if (uncompressedLength > maxArchiveSize) { + } else if (uncompressedLength > maxUncompressedSize) { yield ArchiveIssue( - 'Uncompressed package archive is too large (size > $maxArchiveSize).', + 'Uncompressed package archive is too large (size > $maxUncompressedSize).', ); return; } diff --git a/pkg/pub_package_reader/test/archive_surface_test.dart b/pkg/pub_package_reader/test/archive_surface_test.dart index ee8063061e..e67f30c4d4 100644 --- a/pkg/pub_package_reader/test/archive_surface_test.dart +++ b/pkg/pub_package_reader/test/archive_surface_test.dart @@ -84,7 +84,7 @@ void main() { final summary = await summarizePackageArchive( archiveFile.path, - maxArchiveSize: 199999, + maxUncompressedSize: 199999, ); expect(summary.issues, isNotEmpty); expect(