From 5f3c8b5f5b535e38c949342379b2bcfedc9f9f7b Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Oct 2026 02:55:29 +0000 Subject: [PATCH] Fix Changelog view crashing on Windows (CRLF) checkouts; v1.9.4 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 Claude-Session: https://claude.ai/code/session_01QoR1wxcaDjVVk3xmd5rRCt --- CHANGELOG.md | 7 +++++++ CLAUDE.md | 4 ++-- README.md | 4 ++-- index.html | 2 +- js/views-db.js | 4 +++- js/views-settings.js | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9849570..1144552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). --- +## [1.9.4] — 2026-10-25 + +### Fixed +- **The developer Changelog view crashed on Windows.** At startup the console showed `Uncaught TypeError: Cannot read properties of null (reading '1')` at `views-db.js:734`. The changelog text is embedded in `views-db.js` and read back with `Function.toString()` and a regex that expected `\n` line endings. Git for Windows (`core.autocrlf`) checks files out with `\r\n`, so the regex found nothing. Because the error stopped `views-db.js` partway through, the `changelog` view was never registered. Line endings are now normalized before matching, and a failed match shows a message instead of throwing. The bug was already on `master`. + +--- + ## [1.9.3] — 2026-10-25 ### Fixed diff --git a/CLAUDE.md b/CLAUDE.md index d6e2fb9..23c6fac 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -59,7 +59,7 @@ Until then, this section is the rule. FinLens is a **single-origin, zero-build, vanilla JavaScript personal finance dashboard** that runs entirely in the browser. There is no server, no npm, no bundler, no framework, and no TypeScript. The entry point is `index.html`; everything else is a plain `.js` file in the `js/` folder. -**Current version:** v1.9.3 (updated in `index.html` footer, `README.md`, and `CHANGELOG.md` on every release). +**Current version:** v1.9.4 (updated in `index.html` footer, `README.md`, and `CHANGELOG.md` on every release). **What it does:** Imports CSV exports from Ally Bank (Checking + Savings) and Chase credit cards, parses and normalizes them into a unified transaction model, and renders a multi-tab financial dashboard with budgeting, debt tracking, savings forecasting, investment planning, and Claude-powered AI analysis. @@ -785,7 +785,7 @@ Multiple Chase card files can be loaded simultaneously. Each gets a unique `acco --- -*Last updated: v1.9.3 — 2026-10-25 (§14 folder permission: re-request on click, Reconnect banner, browser copy wins; v1.9.2: §0 branch, PR and approval workflow added; v1.9.1: §4.5 rehydrate transactions loaded from JSON; v1.9.0: §20 Data & Reset added; v1.8.1: §10 re-upload dedup rewritten for the occurrence-suffix fix; v1.8.0: AI Analysis restored with API-key and output hardening; `renderMarkdown()` added; `samples/` added; §1–3, §13, §14, §17 corrected to match the code)* +*Last updated: v1.9.4 — 2026-10-25 (views-db.js changelog reads CRLF checkouts; v1.9.3: §14 folder permission: re-request on click, Reconnect banner, browser copy wins; v1.9.2: §0 branch, PR and approval workflow added; v1.9.1: §4.5 rehydrate transactions loaded from JSON; v1.9.0: §20 Data & Reset added; v1.8.1: §10 re-upload dedup rewritten for the occurrence-suffix fix; v1.8.0: AI Analysis restored with API-key and output hardening; `renderMarkdown()` added; `samples/` added; §1–3, §13, §14, §17 corrected to match the code)* --- diff --git a/README.md b/README.md index 9cf89d5..e007294 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > A zero-install, browser-native finance dashboard. Drop in your bank CSVs, get instant clarity on your money. -**Version:** v1.9.3  ·  **Stack:** Vanilla JS, HTML, CSS  ·  **Install:** None +**Version:** v1.9.4  ·  **Stack:** Vanilla JS, HTML, CSS  ·  **Install:** None --- @@ -235,4 +235,4 @@ See [CHANGELOG.md](CHANGELOG.md) for the full release history. --- -*FinLens v1.9.3 — Built for one person's finances, designed to be useful for anyone's.* +*FinLens v1.9.4 — Built for one person's finances, designed to be useful for anyone's.* diff --git a/index.html b/index.html index eed0766..221bd42 100644 --- a/index.html +++ b/index.html @@ -326,7 +326,7 @@
⚙️ Settings
diff --git a/js/views-db.js b/js/views-db.js index 8ad8a76..3901e2b 100644 --- a/js/views-db.js +++ b/js/views-db.js @@ -522,6 +522,8 @@ registerView('db-inspector', 'DB Inspector', (root) => { // Block-comment trick: content lives inside /* ... */ so no character // escaping is needed (backticks, dollar signs, etc. are all fine). // Only restriction: the string must not contain the sequence */ +// Line endings are normalized first: Git for Windows (core.autocrlf) checks files out +// with CRLF, and Function.toString() returns the source as written. const CHANGELOG_MD = (function(){/* # FinLens Changelog @@ -731,7 +733,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Savings forecast simulator with scenario save/load. - Debt payoff simulator (avalanche vs. snowball). - Recurring transaction detection. -*/}).toString().match(/\/\*\n([\s\S]*)\n\*\//)[1]; +*/}).toString().replace(/\r\n?/g, '\n').match(/\/\*\n([\s\S]*)\n\*\//)?.[1] ?? '_The changelog text could not be read._'; registerView('changelog', 'Changelog', (root) => { diff --git a/js/views-settings.js b/js/views-settings.js index fe5e875..ddd6acd 100644 --- a/js/views-settings.js +++ b/js/views-settings.js @@ -49,7 +49,7 @@ function _renderGeneralSettings(root) { -
FinLens v1.9.3 ·${State.transactions.length} transactions loaded${State.lastRefresh?' · Refreshed '+dayjs(State.lastRefresh).format('MMM D, YYYY h:mm A'):''}
`; +
FinLens v1.9.4 ·${State.transactions.length} transactions loaded${State.lastRefresh?' · Refreshed '+dayjs(State.lastRefresh).format('MMM D, YYYY h:mm A'):''}
`; root.appendChild(displayCard); /* ---- Anthropic API Key ---- */