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
fix(web): show no date for a ZIP member whose date was never set - #47908
A ZIP whose members have no stored date shows a made-up "11/30/1979" in the Modified column of the Files panel instead of "-". Go's archive/zip writes such ZIPs by default, so they are common.
Steps (Linux, no sign-in):
sudo apt install golang unzip, then save this as /tmp/gozip/main.go:
package main
import (
"archive/zip""os"
)
funcmain() {
f, _:=os.Create(os.Args[1])
w:=zip.NewWriter(f)
e, _:=w.Create("a.txt")
e.Write([]byte("hi"))
w.Close()
f.Close()
}
cd /tmp/gozip && go mod init gozip && go run . ~/demo/go.zip (any folder you can open as a project). unzip -lv ~/demo/go.zip shows 00-00-1980 00:00, so the date field really is 0.
Start T3 Code on ~/demo, open the Files panel and click go.zip.
Expected: the Modified column shows "-", as for TAR members with an unknown date. Actual: it shows 11/30/1979.
Cause
A DOS date of 0 means month 0, day 0. JSZip's readDate turns that into Date.UTC(1980, -1, 0), which is 30 Nov 1979. apps/web/src/components/files/binaryPreview.worker.ts:312 only checks for NaN, so the date passes through and formatArchiveModifiedDate (binaryPreviewProtocol.ts:13) prints it. The TAR path and members with no date already give null.
Related merged PRs on the same line: #43307 (ZIP previews show the archived date), #43652 (wall-clock reading around daylight saving gaps) and #44049 (the ZIP directory's own date). None handles an unset date.
Change
The ZIP branch of the worker also returns null when the date's year is before 1980, the first valid DOS year. Five added lines and one removed, in binaryPreview.worker.ts.
Scope
Small fix of an obvious bug, steps reproduce it, so it needs no issue.
Verification
New case in binaryPreview.worker.test.ts, shows no date for a ZIP member whose stored date was never set. It opens a 133-byte ZIP written by Go's archive/zip with the program above (bytes embedded as base64, byte for byte what go run produced here) and expects modified: null.
Test commit alone, fails on main afbb61924f:
FAIL |unit| src/components/files/binaryPreview.worker.test.ts > shows no date for a ZIP member whose stored date was never set
AssertionError: expected { type: 'archive', …(1) } to deeply equal { type: 'archive', …(1) }
- "modified": null,
+ "modified": "1979-11-30T00:00:00.000",
❯ src/components/files/binaryPreview.worker.test.ts:549:7
Tests 1 failed | 17 passed (18)
With the fix: Tests 18 passed (18).
vp run check:changed: format, lint, knip, typecheck (2 packages), test (1 file, 18 passed) and react compiler all pass.
Not verified: I did not open the ZIP in a running app on Linux; the Go program was run on macOS (the same archive/zip output) and the worker test drives the same bytes.
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.
Macroscope's review found this PR approvable — ZIP entries with unset timestamps now display the existing missing-date placeholder instead of a misleading 1979 date. The change affects preview metadata only, not archive contents or stored data.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 392d37e and fefcae8.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
ZIP entries with invalid dates or UTC years before 1980 now report modified: null. A test checks this behavior with a Go-generated archive whose DOS date and time fields are zero.
Changes: ZIP timestamp handling
Layer / File(s)
Summary
Validate ZIP entry timestamps apps/web/src/components/files/binaryPreview.worker.ts, apps/web/src/components/files/binaryPreview.worker.test.ts
The worker returns null for invalid dates and dates before 1980. The test verifies that an archive with zero DOS date and time fields returns modified: null.
ZIP members whose date was never set now show no date instead of November 30, 1979. The change is narrow and low risk.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title is a conventional-commit style summary that names the main change: ZIP members with an unset date now show no date instead of 11/30/1979. The changeset matches it: the worker returns null fo…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives reproduction steps and expected and actual behavior. The Change section explai…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title is a conventional-commit style summary that names the main change: ZIP members with an unset date now show no date instead of 11/30/1979. The changeset matches it: the worker returns null for ZIP dates before 1980, and a regression test was added. The title is specific and accurate.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives reproduction steps and expected and actual behavior. The Change section explains the one-line-of-logic fix. Scope explains why no issue is linked. Verification lists a focused new test, the failing output on main, the passing result with the fix, and a clear statement of what was not verified. The model and harness are named at the end as the template asks. The description does not link an issue, but it justifies that choice as an obvious small bug, which the template allows.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Environment: real web app in Chromium, 1280×800, light theme, English US, fresh isolated database per commit, T3CODE_DEV_SEED=0, Replay multi-turn on both sides.
On both commits, seeded a fresh project with README.md and the identical Go-generated go.zip containing a.txt = hi, with no Modified value set (zero DOS date/time). Created one Replay multi-turn thread with the same message, opened it directly, waited for first fixture turn complete, opened Toggle right panel → Files → go.zip, and captured the archive row.
Scenario: ZIP member with no stored date shows a dash
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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.
Problem
A ZIP whose members have no stored date shows a made-up "11/30/1979" in the Modified column of the Files panel instead of "-". Go's
archive/zipwrites such ZIPs by default, so they are common.Steps (Linux, no sign-in):
sudo apt install golang unzip, then save this as/tmp/gozip/main.go:cd /tmp/gozip && go mod init gozip && go run . ~/demo/go.zip(any folder you can open as a project).unzip -lv ~/demo/go.zipshows00-00-1980 00:00, so the date field really is 0.Start T3 Code on
~/demo, open the Files panel and clickgo.zip.Expected: the Modified column shows "-", as for TAR members with an unknown date. Actual: it shows 11/30/1979.
Cause
A DOS date of 0 means month 0, day 0. JSZip's
readDateturns that intoDate.UTC(1980, -1, 0), which is 30 Nov 1979.apps/web/src/components/files/binaryPreview.worker.ts:312only checks forNaN, so the date passes through andformatArchiveModifiedDate(binaryPreviewProtocol.ts:13) prints it. The TAR path and members with no date already givenull.Related merged PRs on the same line: #43307 (ZIP previews show the archived date), #43652 (wall-clock reading around daylight saving gaps) and #44049 (the ZIP directory's own date). None handles an unset date.
Change
The ZIP branch of the worker also returns
nullwhen the date's year is before 1980, the first valid DOS year. Five added lines and one removed, inbinaryPreview.worker.ts.Scope
Small fix of an obvious bug, steps reproduce it, so it needs no issue.
Verification
New case in
binaryPreview.worker.test.ts,shows no date for a ZIP member whose stored date was never set. It opens a 133-byte ZIP written by Go'sarchive/zipwith the program above (bytes embedded as base64, byte for byte whatgo runproduced here) and expectsmodified: null.Test commit alone, fails on main
afbb61924f:With the fix:
Tests 18 passed (18).vp run check:changed: format, lint, knip, typecheck (2 packages), test (1 file, 18 passed) and react compiler all pass.Not verified: I did not open the ZIP in a running app on Linux; the Go program was run on macOS (the same
archive/zipoutput) and the worker test drives the same bytes.Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.