perf(logs): poll request history incrementally - #3250
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
리뷰 · 우선순위 56 / 80이 PR은 대시보드 로그 화면이 매번 최대 2,000줄을 통째로 다시 받아오던 폴링을, 불투명 커서 기반 증분(delta) 읽기로 바꾸는 성능 개선이다. 지금 서버 쪽은 새 파일 클라이언트는 현재 HEAD 기준으로는 실사용 구멍이 아니라 대역폭/CPU 비용 줄이기다. 그래서 점수는 중간이다. 같은 주 동작 설계(퇴거 시 reset, 잘못된 커서 400, 구서버 폴백)는 건전하다. 다만 필터+커서를 같이 쓰는 API 소비자는
메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Summary
Replace 2,000-row full snapshot polling on
GET /api/logswith a backward-compatible opaque cursor delta protocol:GET /api/logs?cursor=<opaque>decodes a safe base64url cursor ({ v: 1, t: timestamp, id: requestId }), matches against the in-memory log ring, and returns only entries appended since the cursor along with additive metadata (cursor,reset: boolean).reset: trueso the client transparently resets without losing data.invalid_cursor.Logs.tsxrequests incremental deltas after the initial full fetch, merging new rows byrequestIdup to the 2,000-row cap, while falling back cleanly to full snapshots when talking to older servers.Verification
Automated Test Gates
bun run typecheck bun run privacy:scan # Result: TypeScript clean, Privacy scan passedbun run test:changed # Result: 2999 pass, 0 fail across 167 files (22225 expect() calls)UI Verification
Visual layout, controls, filters, auto-refresh toggles, and detail dialogs remain bit-for-bit identical; network payload on background polling drops from ~7.3 MB per tick (full 2,000 DTOs) to < 1 KB (empty or incremental delta).
Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.