fix(instatus): anchor the year heuristic on the entry's earliest timestamp - #21
Open
anthonybaldwin wants to merge 1 commit into
Open
fix(instatus): anchor the year heuristic on the entry's earliest timestamp#21anthonybaldwin wants to merge 1 commit into
anthonybaldwin wants to merge 1 commit into
Conversation
…stamp The Instatus Atom feed omits the year from each update's `<small>` timestamp, so the parser reconstructed it from `<published>` and rolled forward a year for anything landing more than 24h before it. That assumes `<published>` is a lower bound on the entry's updates, which holds for incidents but not for scheduled maintenance: there `<published>` is the scheduled START, while the announcement update is posted days or weeks earlier (and `<updated>` carries that time). An early announcement was therefore dated a year ahead, which made it sort last, so the entry's status came from the announcement instead of the final "Completed" update. `resolved_at` stayed null and the maintenance was counted open forever — it kept a pinned card ungreyed and inflated the presence ticker's active-incident count. Kagi's Jul 19 database maintenance (announced Jul 8) has been stuck open since Jul 19. Anchor on the earlier of `<published>` and `<updated>` instead. Verified against the live kagi and perplexity feeds: this changes exactly one update timestamp (the stuck announcement) and drops the false open incident, with no other timestamp shifting.
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.
Problem
The presence ticker reported 6 active incidents while only 5 were real. The extra one was Kagi's
Database maintenance for Kagi Search(cmrbr5ynx05vc0kp9eoawdsbu), which completed on 2026-07-19 but has been counted open ever since — it also left a stale pinned card in the kagi channel.Root cause
The Instatus Atom feed omits the year from each update's
<small>timestamp.parseUpdateTimestampreconstructed it from<published>and rolled forward a year for anything landing >24h before it.That assumes
<published>is a lower bound on the entry's updates. True for incidents; false for scheduled maintenance, where<published>is the scheduled start and the announcement is posted days earlier (<updated>carries the announcement time):Jul 8 is 11 days before
<published>, so it was dated 2027-07-08.parseUpdateBlockssorts chronologically, so the announcement sorted last, and the entry's derived status came from it (in_progress) instead of the finalCompleted.resolved_atstayednull→ permanently open.Document order can't be used as a fallback signal — real feeds emit update blocks out of order (kagi and perplexity both emit
ResolvedbeforeInvestigatingon some entries).Fix
Anchor the year heuristic on the earlier of
<published>and<updated>— a genuine lower bound for both entry types.Verification
...:2027-07-08→...:2026-07-08) and kagi's false open incident drops to zero. No other timestamp or id shifts.Deploy note
The update id embeds its timestamp, so the one changed id counts as unseen and would re-post that resolved maintenance once. Handled by a one-time
state.jsonrepair alongside the rollout.