AntFleet

Disagreement · bdb225d0-openai-0

Use of Array.prototype.toSorted requires Node 20+ — may crash on Node 18 runtimes

mismatch
repo e24ef98c·PR #10·reviewed 1 week ago

Primary finding

Use of Array.prototype.toSorted requires Node 20+ — may crash on Node 18 runtimes

mediumbuild-releasemedium
  • apps/web/app/receipts.rss/route.ts:51-53
  • apps/web/scripts/backfill-benchmark-flag.ts:189-191
Array.prototype.toSorted is an ES2023 feature available in Node 20+. If this code runs in environments pinned to Node 18 (common in older Next.js/Vercel setups or developer machines), the call will throw TypeError: items.toSorted is not a function at runtime, breaking the RSS route and the admin script.

Recommendation

Either ensure the deployment and tooling are locked to Node 20+ (via engines field, CI matrix, and hosting runtime), or replace toSorted with a backward-compatible pattern: const items = [...sameRepoItems, ...crossRepoItems].sort((a,b)=>...). For the script: Array.from(...).sort(...).

Counterpart finding

RSS lastBuildDate fallback uses `new Date()` when both feeds are empty — defeats Cache-Control freshness

lowbugmedium
  • apps/web/app/receipts.rss/route.ts:57-67
When there are no receipts at all, lastBuildDate is set to `new Date()` (request time). Combined with `Cache-Control: public, max-age=300, s-maxage=300`, the feed body changes (lastBuildDate moves) on every fresh edge fetch, but RSS readers that cache by lastBuildDate may see a 'new' feed every 5 minutes despite no actual content change. Minor — more annoying than incorrect — but readers may show spurious updates on Slack /feed.

Recommendation

When both feeds are empty, use a fixed epoch (e.g., a build-time constant) or omit lastBuildDate.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →