Never move last seen back or first seen forward (closes #162) #170

Merged
clawbot merged 1 commits from issue-162-seen-times into next 2026-10-27 01:10:02 +01:00
1 Commits
Author SHA1 Message Date
sneak 25c7b87991 Never move last seen back or first seen forward (closes #162)
check / check (push) Waiting to run
Some RIS collectors send updates days old while they catch up on a
backlog. Every update to a stored AS, peering or peer set last_seen to
the update's time, even an older one, and never lowered first_seen. An
AS page could then list a peer first seen after it was last seen.

The update statements for asns, peerings and bgp_peers now keep the
earlier of the stored and new first_seen and the later of the stored
and new last_seen, with MIN and MAX in the SQL. The batch and the
single-row writes share each statement. GetOrCreateASN returns the
times the row now holds. Route times are unchanged.

Model: opus-5-5
2026-10-26 23:58:48 +00:00