Skip to content

perf(listener): leave activity time out of the session fingerprint - #37

Merged
tak-bro merged 1 commit into
mainfrom
perf/fingerprint-skip-activity
Nov 4, 2026
Merged

tak-bro merged 1 commit into
mainfrom
perf/fingerprint-skip-activity

Conversation

@tak-bro

@tak-bro tak-bro commented Nov 4, 2026

Copy link
Copy Markdown
Member

Summary

listener.sessions 보고 지문에서 lastActivityAt·stateChangedAt 를 뺐다. 두 값은 터미널 출력마다 바뀐다. 그래서 5초 주기마다 보고가 나갔고, 서버는 그때마다 약 10 KB 기기 레코드를 다시 썼다. 서버도 이 두 값을 더는 비교하지 않는다(hwipit/hwip#705). 시각 값은 다른 필드가 바뀐 다음 보고나 120초 heartbeat 에 실려 간다.

Changes

  • src/listener.ts: sessionsFingerprint 에서 두 필드를 뺐다. 왜 빼는지 JSDoc 에 적었다.
  • src/listener.test.ts: 활동 시각만 바뀌면 지문이 그대로인지 확인하는 테스트를 추가했다.

How to Test

npx vitest run src/listener.test.ts -t "activity time alone"
npx vitest run

Evidence

  • red(구현 전): Tests 1 failed | 166 skipped (167)
  • green: listener.test.ts 통과. 전체 스위트는 Tests 8 failed | 5668 passed | 1 skipped (5677) 이다. 8건 실패는 모두 src/http-proxy.test.ts 에서 난다. origin/main 에서도 똑같이 8건 실패하고, sandbox 밖에서 돌려도 같다. 이 PR 과 무관한 기존 실패다.

Risks

  • 사이드바 정렬과 "마지막 활동" 표시가 최대 120초(heartbeat) 늦어질 수 있다. 결정에 따른 의도된 결과다. 상태 전이는 지문에 남아 있어서 바로 보고된다.
  • 배포 순서: hwipit/hwip#705 가 먼저 나가거나 함께 나가는 쪽이 맞다. JSDoc 의 "server does not compare them either" 는 그 PR 이 나간 뒤에야 사실이 된다. CLI 가 먼저 나가도 서버 쓰기가 줄 뿐이라 동작에는 해가 없다.
  • 기존 동작(이번 변경 무관): fingerprint 에는 parentName·inProcess 가 없는데, 서버 비교 목록에는 둘 다 있다.

Merge danger

  • Door: two-way. 되돌리면 그대로 복구된다.
  • Blast radius: listener

Auto-decided

  • 버전 bump 와 릴리스는 이 PR 에서 하지 않는다. 평소 릴리스 흐름을 따른다.

🤖 Generated with Claude Code

lastActivityAt and stateChangedAt move on every terminal output, so
fingerprinting them sent a listener.sessions report on almost every
5 s cycle, and the server rewrote the device record each time. The
server no longer compares them; the times now ride the next report
that changes something else, or the 120 s heartbeat.
@tak-bro
tak-bro marked this pull request as ready for review November 4, 2026 03:28
@tak-bro
tak-bro merged commit f8f7646 into main Nov 4, 2026
4 checks passed
@tak-bro
tak-bro deleted the perf/fingerprint-skip-activity branch November 4, 2026 03:29
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.1.19 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant