Primary finding
RSS feed crashes when a cross-repo merged row has null mergedAt (type lies)
- apps/web/app/receipts.rss/route.ts:39-49
- apps/web/lib/receipts.ts:117-145
The CrossRepoReceiptRow type declares mergedAt: Date (non-null) and mapMergedRowsToReceipts filters out rows with null mergedAt, so under normal operation the RSS handler's r.mergedAt.getTime() call in the .toSorted comparator is safe. However, the sort comparator uses pubDate.getTime() — for same-repo items the type asserts closedAt: Date (filtered via `r.closedAt !== null`), and for cross-repo it requires Date. This is consistent so no immediate bug, but worth verifying the row guarantees hold.
Recommendation
No change needed; the guards in mapMergedRowsToReceipts and the same-repo filter in route.ts maintain the Date invariant. Consider adding a runtime assertion in mapMergedRowsToReceipts to log when a row is dropped to detect schema drift.