Skip to content

Commit 48e8bc0

Browse files
committed
Fix /feed.atom's internal stability by using the latest version creation timestamp.
1 parent 7419a8d commit 48e8bc0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/lib/frontend/handlers/atom_feed.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ Feed _feedFromPackageVersions(List<PackageVersion> versions) {
158158
final alternateUrl =
159159
activeConfiguration.primarySiteUri.resolve('/').toString();
160160
final author = 'Dart Team';
161-
final updated = clock.now().toUtc();
161+
// Set the updated timestamp to the latest version timestamp. This prevents
162+
// unnecessary updates in the exported API bucket and makes tests consistent.
163+
final updated = versions.isNotEmpty
164+
? versions.map((v) => v.created!).reduce((a, b) => a.isAfter(b) ? a : b)
165+
: clock.now().toUtc();
162166

163167
return Feed(id, title, subTitle, updated, author, alternateUrl, selfUrl,
164168
'Pub Feed Generator', '0.1.0', entries);

0 commit comments

Comments
 (0)