Repository navigation
v1.9.4: fix Changelog view crashing on Windows (CRLF) checkouts - #8
Merged
Merged
Conversation
views-db.js embeds the changelog in a block comment and reads it back with Function.toString() plus a regex expecting \n. Git for Windows checks files out with \r\n, so match() returned null and [1] threw at load: "Cannot read properties of null (reading '1')" at views-db.js:734. The rest of views-db.js never ran, so the changelog view wasn't registered. Normalize line endings before matching, and fall back to a message instead of throwing. Found during Luis's manual test of #3 in Edge. Pre-existing on master. Tested headless: LF and CRLF checkouts both register the view and render 15 versions with no errors; the unfixed CRLF copy still reproduces the crash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QoR1wxcaDjVVk3xmd5rRCt
Open
33 tasks
Owner
Author
Tested on Windows (Edge): passesTested at
Line endings: the clone checks files out as CRLF.
Before (master): the crash reproduces, and the view isn't registered.
After (this branch): the console is clean at startup.
Changelog view:
Other views in
Notes
The "To check" item is done. Approved for merge at |
3 tasks done
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.








The bug
On Windows, the console showed this at startup:
Luis found it while testing #3 in Edge. It was already on
master.Cause
views-db.jsembeds the developer Changelog's text inside a block comment and reads it back withFunction.toString()./\/\*\n([\s\S]*)\n\*\//expects\nline endings.\r\n(core.autocrlf=trueis its default).toString()returns the source exactly as written, somatch()returnednulland[1]threw.views-db.jspartway through loading, so thechangelogview was never registered. Nothing else was affected: it's a developer-only view, and each script loads separately.Fix
.replace(/\r\n?/g, '\n')runs before the match.?.[1] ?? '…could not be read'shows a message if the text can't be read.How it was tested
Headless Chromium:
.js/.htmlconverted)\rleft in the textThe all-views smoke test (23 views and 6 Settings tabs, light and dark) also passes.
Not changed
The embedded changelog copy stops at v1.4.1, while
CHANGELOG.mdis current. Keeping the two in sync would be a separate change.To check
TypeErrorshould be gone. In DevTools,showView('changelog')should open the Changelog view.Generated by Claude Code