Repository navigation
fix(webapp): accept injected clock in staleNote and buildExitSaveRequest - #359
Merged
Merged
Conversation
runbear-bot
approved these changes
Nov 12, 2026
runbear-bot
left a comment
Collaborator
There was a problem hiding this comment.
Bobb's bot(Totoro) Review
Conclusion: ready
- 병합을 차단할 결함은 발견하지 못했습니다.
- 두 함수는 기본적으로 현재 시각을 사용하며 주입된 시각을 각각 경과 시간 계산과 충돌 파일명 생성에 전달합니다. 경계값과 고정 충돌 파일명 테스트도 추가되었습니다.
- 정적 자산의 참조 경로를 확인했으며 누락된 파일은 발견하지 못했습니다.
- 클린 체크아웃에 의존성이 없어 로컬 패키지 테스트는 실행하지 않았습니다.
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.
TL;DR
now = Date.now()clock parameter tostaleNoteandbuildExitSaveRequest, completing the pure clock-injection contract acrossfrontend/src/lib/.heat.test.tspinned to a deterministic timestamp instead of reading the live calendar clock, fixing the date-dependentnpm testfailure.STALE_DAYS - 1vsSTALE_DAYSboundary assertions and pins deterministic conflict naming insharedfile_restore.test.ts.Fixes #332
What & why
Other pure time-dependent helpers in
internal/webapp/frontend/src/lib/(daysSince,staleHot,readsByFolder,greeting,dateWindow,historyApiQuery,dayLabel,agoShort) accept an optionalnowargument so callers use the wall clock by default while unit tests pass fixed timestamps. Two helpers broke that contract:heat.ts::staleNotecalleddaysSince(time)without forwardingnow, causingheat.test.ts's"yesterday"fixture (2026-08-17T00:00:00Z) to age pastSTALE_DAYSas calendar time moved forward.editbeacon.ts::buildExitSaveRequestcallednew Date()directly when minting a plain-folder conflict path.Both functions now accept
now = Date.now(), leaving existing callers unchanged while making unit tests deterministic at any calendar date.Checklist
go build ./... && go vet ./... && go test ./...greeninternal/syncer(N/A: syncer untouched)npm run buildre-committedinternal/webapp/staticandnpm run e2egreen (npm test305/305 + Playwrightdashboard.spec.ts&browse.spec.ts90/90)README.mdandplugin/skills/beardrive/SKILL.md(N/A: CLI untouched)