Repository navigation
Keep trying lastmod date formats until one of them parses - #606
Merged
ethangardner merged 2 commits intoNov 6, 2026
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
ethangardner
approved these changes
Nov 6, 2026
ethangardner
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution. This looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dateFormatslists MM/DD/YYYY and DD/MM/YYYY under an identical regex, so a day-first<lastmod>always matches the month-first entry first.parseFallbackDatereturns that parser's output without checking it, and for20/02/2025the month-first parser builds2025-20-02, an Invalid Date. Invalid Dates are truthy, soparseDatepasses it along andgetLastModDatecallstoISOString()on it, throwingRangeError: Invalid time value.runPagecatches the throw, butparseBrowserErrorhas no pattern for it, so the entire sitemap.xml page is stored asunknown_errorand every sitemap column for that domain is cleared, not only the lastmod. I checked that classification by passing the RangeError throughparseBrowserErrordirectly.The loop now continues until a format actually parses, which also makes the DD/MM/YYYY entry reachable for the first time.
isDateran the same loop with the same flaw, so it delegates now. The new spec drivescreateSitemapXmlScannerand throws on main.AI assistance was used on this change and is disclosed in the commit trailer.