Repository navigation
fix(website): surface when community metrics were last refreshed - #330
Merged
danbaruka merged 1 commit intoOct 16, 2026
Merged
Conversation
MonthlyPulse rendered the numbers with no date, and the build-time fetch stamped every payload with the current time even when the API call failed, so a months-old snapshot could render as fresh with nothing on the page or in the build log saying otherwise. - MonthlyPulse renders "Data as of <date>" from updatedAt, formatted in UTC by hand (not toLocaleDateString) so the server and client render identical strings and the date cannot mismatch on hydration. A payload flagged stale appends "— GitHub API unavailable at build time". - fetch-github-data.js advances updatedAt only when every request in the run succeeded, preserves the previous timestamp otherwise, marks the payload stale, and warns in the build log with the snapshot's age plus a second warning past a 7-day threshold. The build does not fail on purpose: a transient API or rate-limit failure should not block a deploy. Verified both paths — a full refresh yields updatedAt today with stale false; a run whose requests fail keeps the previous timestamp and stats and prints both warnings. Fixes IntersectMBO#327
IanoNjuguna
force-pushed
the
fix/community-metrics-freshness
branch
from
October 14, 2026 10:38
4602182 to
e246d73
Compare
danbaruka
approved these changes
Oct 16, 2026
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.
Description
Makes the freshness of the community metrics visible, which is what #327 asks for. Two changes:
MonthlyPulse.tsxrenders "Data as of 1 Aug 2026" style caption under the stats grid, taken fromupdatedAt. Formatted by hand in UTC rather than withtoLocaleDateString, so the server-rendered and client-rendered strings are identical and the date can never mismatch on hydration. When the payload is flagged stale it appends "— GitHub API unavailable at build time".scripts/fetch-github-data.jsno longer stamps a failed fetch as fresh. PreviouslyupdatedAtwas unconditionallynew Date(), so a failed API call produced a payload whose timestamp claimed "now" while the numbers were months old — rendering that timestamp as-is would have been worse than showing nothing. Now:updatedAtadvances only when every request in the run succeeded; otherwise the previous timestamp is preserved.stale: truewhen the run did not fully refresh.Deliberately not failing the build: a transient API or rate-limit failure should not block a deploy of a documentation site. Visibility is the fix — the rendered date plus a loud warning. A hard gate is easy to add as a follow-up if that is preferred.
Semantics, stated plainly:
updatedAtis when a complete refresh last succeeded. A partial refresh (say the contributors call fails while the stats calls succeed) keeps the older date and setsstale: true, so the site understates freshness rather than overstating it.Fixes #327
Type of Change
Testing
onBrokenLinks: "throw"andonBrokenAnchors: "throw"and passesScript, both paths:
tsc --noEmitpasses both with and without the newstalekey in the snapshot, since the committed file predates the field and the component reads it defensively.Production build passes and the caption renders under the stats grid.
Notes for review
website/src/data/githubData.jsonis untouched by this PR — it is regenerated by theprebuildhook on every build, and the working-tree copy a build produces is not part of the diff.MonthlyPulseis changed.Contributors.tsxrenders the same payload and could get the same treatment; that overlaps Contributor list can include bot and AI-agent accounts (cursoragent is one today) #326 and was kept out.Checklist