Review history drops older reports that still fit
Maintainer thường phản hồi trong vòng 1 ngày
@HellHBBD đang làm issue này rồi.
Từ ngày 6/11/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Observed behavior
The browser-local review archive prematurely drops older reports, even when the 500-entry limit and the 164 KiB byte budget would allow them to be retained.
In web/history.js, boundedReviews() limits the input to the first 500 candidates before checking whether each report fits the remaining byte budget. A skipped report still consumes an input position, preventing an older report from being considered.
In a deterministic reproduction, saving three large reports into an initially full 500-entry archive leaves only 499 reports after the third save. An older report (old-497) disappears even though retaining it would keep the archive within both limits.
This affects browser-local report history. The reproduction does not demonstrate account-database report loss.
Expected behavior
A report that cannot fit within the remaining byte budget should be skipped without consuming a retained-report slot.
Older candidates should continue to be considered until either 500 reports have been retained or all available candidates have been examined.
In the reproduced scenario, the archive should retain exactly 500 reports, including old-497, totaling 160,917 bytes, below the 164 KiB (167,936 bytes) budget.
Existing newest-first ordering, UTF-8 byte accounting, code stripping, and short-history retention should remain unchanged.
Reproduction
Reproduced using the real history persistence module on upstream main at commit b2c2bc9aca5e9e70f28ff2a16e4bd0b2d5e87a2f, with Node.js v26.12.1, in-memory storage, and a mocked signed-out session.
Steps to reproduce
- Seed
codetrial_review_historywith 500 small reports,old-0throughold-499. - Seed
codetrial_historywith the newest 20 entries. - Call
saveReportHistory()three times with distinct reports containing 56,000-character summaries. - Inspect the retained review archive after each save.
Observed results
- First save: 500 retained reports, 104,904 bytes; oldest retained:
old-498. - Second save: 500 retained reports, 160,917 bytes; oldest retained:
old-497. - Third save: 499 retained reports, 160,819 bytes; oldest retained:
old-496.
After the third save, old-497 is missing. Restoring it would produce 500 reports totaling 160,917 bytes, below the 164 KiB (167,936 bytes) limit.
The failure is deterministic with this setup. The reproduction uses mocked browser storage rather than an interactive interview.
CodeTrial version
codetrial 0.1.0 (b2c2bc9)
Environment
OS: Arch Linux
Browser: Not applicable; reproduced under Node.js v26.12.1 with mocked browser storage.
Language: Not applicable.
Interview loop: Not applicable; no interview session was started.
Problem: Not applicable; browser-local review-history persistence.
REACTO or STAR step: Not applicable.
Reconnect: Not applicable.
Reproduction environment: Real web/history.js persistence module, in-memory storage, and a mocked signed-out /api/session response.
Sanitized evidence
The regression assertion fails on the unmodified upstream implementation:
AssertionError: Archive should retain 500 reports when another older report fits
499 !== 500
Relevant implementation (web/history.js, lines 462-489):
for (const row of reviews.slice(0, REVIEW_HISTORY_CAP)) {
The input is truncated before the byte-budget check. Candidates skipped for exceeding the remaining budget still occupy positions within the first 500 inputs, so older candidates are not considered.
The existing oversized-review test in tests/browser/account.test.js (lines 864-880) does not cover this interaction between a full 500-entry archive and byte-budget rejection.
Related work: #221 and PR #321 address final-code retention, not this premature review-archive eviction.
The reproduction uses synthetic report identifiers and summaries. No credentials, session tokens, recordings, or personal interview content are included.
Public data confirmation
- I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
- Ngôn ngữ chính
- Rust
- Star
- 223
- Fork
- 148
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 227
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sysprog21/codetrial
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sysprog21/codetrial#604 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Compare code semantically across a force push in review bundlesCó thể đã có người làm @Alan52254 đã nhận hôm nay. Đang mở
sysprog21/codetrial#606 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Calculator % disagrees with // on negative operandsCó thể đã có người làm @YunJ-Chang đã nhận hôm nay. Đang mở
sysprog21/codetrial#602 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Start does nothing visible in the lobby when site data is blockedCó thể đã có người làm @sidney-Hung đã nhận hôm nay. Đang mở
sysprog21/codetrial#600 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a Copy results action to the coding test panelCó thể đã có người làm @seallllllllll đã nhận hôm nay. Đang mở
sysprog21/codetrial#598 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sysprog21/codetrial
Issue tương tự
-
multiple issues priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
storytold/pdfcraft#6469 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
parity priority: low ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
storytold/photocraft#11680 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
triage/needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
praxis-proxy/grid#564 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
ScoopInstaller/Extras#19275 ·
Maintainer thường phản hồi trong vòng 1 ngày