fix: stop stash manager showing Invalid Date for every entry - #154
Merged
Conversation
added 8 commits
August 11, 2026 13:23
…151) Also fix fixtureStash() — the second stash push only touched an untracked file, which git stash push silently drops without --include-untracked, so the fixture only ever produced 1 stash. The new stronger assertion (toHaveLength(2)) exposed this pre-existing bug.
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.
Summary
git_stash_listrequested git's lenient%aidate format ("2026-08-11 09:16:44 +0200" — space-separated, colon-less offset).StashManager.vue'sformatDate()fed that straight intonew Date(), which is implementation-defined for that shape — JavaScriptCore (the shipped macOS/Linux Tauri webview) rejects it, silently producing anInvalid Datewith no exception thrown, so the existing try/catch never fired. V8 (Node/dev:web) and WebView2 (Windows) both tolerate the lenient format, which is why this shipped unnoticed.%aito%aI(strict ISO 8601) — matching the convention already used at 8 other call sites in this codebase.dev-server.mjsroute onto the same%aIplaceholder, which also fixes a second latent divergence: the Rust side used the author date, the dev-server used the committer date. Both sides now emit "whatever git prints for %aI".datefield in the Rust↔Node parity test (it was previously masked with a comment noting the format "can vary subtly") so this exact regression is caught if it ever recurs.Number.isNaN(d.getTime())guard inStashManager.vue'sformatDate()— the existing try/catch was dead code sincenew Date()never throws.git_list_tagshad the same defect (%(taggerdate:iso), lenient) causing "NaN years ago" in the Tags panel — switched to:iso-strictwith the sameNumber.isNaNguard inTagsPanel.vue.Fixes #151.
Test plan
stash_and_tag_date_tests): strict-ISO-8601 shape assertion + round-trip against git's own--date=iso-strictoutput, for both stash and tag dates —cargo test --lib: 183 passedpnpm test:parity— 15 passed, including the now-real (un-blanked)git-stash-listdate comparisonStashManager-date.test.ts(new) — 3 cases:+HH:MMoffset,Z-suffixed UTC, and a garbage string all fall back correctlyvitest run— 678 passed;vue-tsc --noEmit— cleanpnpm dev:webagainst a real stash: Stash Manager now shows a real formatted date ("11 août, 13:51") instead of "Invalid Date"