Repository navigation
fix(aggregator): validate dns/aa section stamps in health feedSections (#2242) - #3091
Conversation
#2242) feedSections blindly computed ageMs from Date.parse: a garbage dns generatedAt rendered NaN/null and a future aa generatedAt rendered age 0 (maximally fresh) for as long as the skew lasted. The from() helper now applies the #1564 convention already used for the top-level stamp: unparseable -> present:false with an invalid generatedAt (...) note; beyond GENERATED_AT_FUTURE_SKEW_MS (60s) in the future -> present:false with a descriptive note. isDnsSection/isAaSection additionally require Number.isFinite(Date.parse(generatedAt)). Regression tests cover garbage and future stamps for both sections plus the inside-skew live case; full aggregator suite 692 pass / 7 fail, identical fail set to clean main (690/7).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #2242. Queue task 4321 (small_fix, pinned by triage task 3400).
Problem
feedSectionsinpm-stack/aggregator/src/health.tscomputedageMs: Math.max(0, now - Date.parse(ts))blindly for every section: a garbage dnsgeneratedAtrendered ageMs NaN/null, and a future aageneratedAtrendered age 0 — maximally fresh — for as long as the skew lasted. The structural guards (isDnsSection,isAaSection) only checkedtypeof generatedAt === "string".Change
health.tsfeedSectionsfrom()helper now applies the aggregator: a garbage or future-dated generatedAt is 'live' forever — the orchestration diagnosis and fleet-feed gate never check that the timestamp parses #1564 convention already used for the top-level stamp: unparseable stamp →present: falsewith aninvalid generatedAt (...)note and no ageMs; stamp more thanGENERATED_AT_FUTURE_SKEW_MS(60s) in the future →present: falsewith a descriptive note. Valid sections render identically.dns.ts/aa.ts:isDnsSectionandisAaSection(both the absent and ok forms) requireNumber.isFinite(Date.parse(s.generatedAt)).Tests (laptop; no PR CI covers
pm-stack/**, #2936)bun test test/health.test.ts: 18/18 pass, including 2 new aggregator(health): dns/aa section stamps are never validated — a garbage dns generatedAt renders ageMs NaN/null, a future aa generatedAt renders age 0 (maximally fresh) for as long as the skew lasts #2242 tests — garbage and future stamps for both dns and aa sections, plus the inside-skew (30s future) live case.Need help on this PR? Tag
@codesmith-botwith what you need.