You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Frontend heat test's fixed date makes fresh-file assertion expire #332
npm test has a date-dependent failure in the heat test. The runtime correctly uses the current clock, while the test labels a fixed date as “yesterday.” This is present in v0.18.1 and unchanged in the release candidate.
On 2026-11-03, the unmodified suite reports 204 passes and one failure. The same heat test fails on baseline 64b6af4609c70b3da886b6659ff10ed93c1a2475 and candidate 844e708096d400501f9da5e7f2869d9cfb1a705c.
Reproduce with Node 23 or newer:
cd internal/webapp/frontend
npm test
src/lib/heat.test.ts:250-258 sets now to 2026-08-18T00:00:00Z, derives yesterday from it, then calls staleNote(hot, yesterday) without passing that clock. staleNote uses daysSince(time), whose default clock is Date.now(). In November, that input is several months old and correctly produces a stale label instead of an empty string.
The runtime and test blobs are identical on both commits. An isolated measurement copy changing only this test's local fixture to const now = Date.now() passes all 205 tests with the same assertions. No runtime logic, timeout, or skip needs to change.
Suggested repair: derive this case's dates from the live clock, keeping the separate daysSince test's explicitly injected clock. The release candidate has not changed the repository test file.
Fixed in #359 (merged to main as 6fa608a2e174bc7650dd29f968e2252447eda950, unreleased).
staleNote (internal/webapp/frontend/src/lib/heat.ts) and buildExitSaveRequest (internal/webapp/frontend/src/lib/editbeacon.ts) now accept an optional now = Date.now() parameter like the rest of src/lib/, and heat.test.ts passes its pinned clock explicitly. Verified with npm test (305/305), Playwright dashboard.spec.ts and browse.spec.ts (90/90), and CI run 43221752564.
Activity
isac322 commentedon Nov 12, 2026
Fixed in #359 (merged to
mainas6fa608a2e174bc7650dd29f968e2252447eda950, unreleased).staleNote(internal/webapp/frontend/src/lib/heat.ts) andbuildExitSaveRequest(internal/webapp/frontend/src/lib/editbeacon.ts) now accept an optionalnow = Date.now()parameter like the rest ofsrc/lib/, andheat.test.tspasses its pinned clock explicitly. Verified withnpm test(305/305), Playwrightdashboard.spec.tsandbrowse.spec.ts(90/90), and CI run43221752564.