Repository navigation
v1.9.1: fix AI 'does nothing' + Income crash after booting from finlens-state.json - #4
Merged
Merged
Conversation
loadStateFromFile() returned transactions straight from JSON.parse: dates were strings and the category getter was frozen. monthKey() then threw, which crashed the Income view and made buildFinancialSummary() fail before the AI request was sent. Rebuild them with reconstituteTx(), as DB.loadAll() does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AT1Bh6Sscb8ogzzuf8U3Jc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AT1Bh6Sscb8ogzzuf8U3Jc
This was referenced Oct 24, 2026
5 tasks done
…-dates Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QoR1wxcaDjVVk3xmd5rRCt
…te-file-boot-dates Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QoR1wxcaDjVVk3xmd5rRCt
1 task done
Owner
Author
Manual test: Edge (InPrivate), sample data onlyBranch: Edge drops folder access on every reload (the bug #7 fixes), so a reload never boots from the file. To test the fix, I ran the two startup steps from
Headless comparison (same file):
Notes
|
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.
Summary
Fixes the reported bug: asking Claude a question did nothing. The same root cause also crashed the Income view. It affects anyone whose CSV folder holds a
finlens-state.json, which is the normal setup once the file has been saved, because it's the first thing loaded at boot.Cause
loadStateFromFile()returned the file's transactions straight fromJSON.parse.datebecomes a string.categorygetter is frozen into a plain value.monthKey()then throwsd.getFullYear is not a function. That crashes:byMonth(), and with it the Income view.buildFinancialSummary(). It ran before the request and outside the error handling, so the click made no API call and showed nothing.The bug predates these PRs. On
master, booting from the state file has always worked this way. It surfaced once "Save Now" wrote the file.Fix (
173aa4e)loadStateFromFile()now rebuilds transactions withreconstituteTx(): realDateobjects, thecategorygetter, and transaction edits re-applied. This is the same thingDB.loadAll()already does when booting from IndexedDB.2920b26) separately makes the AI tab show any error instead of doing nothing.How it was tested
A real
finlens-state.jsonwritten by the app is loaded in a fresh browser context the wayinit.jsboots:loadStateFromFile()→Object.assign(State, …).DateobjectscategorygetterbuildFinancialSummary()7/7 new checks pass, and all earlier suites still pass: 33, 27, 18 and 5.
After merging
Open FinLens with your real folder and ask Claude a question with your key. Any remaining problem now appears as a message on the page instead of nothing.
Generated by Claude Code