Skip to content

v1.10.5: fix Import Logs throwing when the view is left before it loads - #18

Merged
gitluis merged 1 commit into
masterfrom
fix-import-log-race
Nov 2, 2026
Merged

gitluis merged 1 commit into
masterfrom
fix-import-log-race

Conversation

@gitluis

@gitluis gitluis commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Version: v1.10.5, a patch on master. It's independent of the open PRs (#10, #16, #17), which are numbered after it. Whichever merges second gets a small conflict in the version lines and CHANGELOG to resolve.

Summary

Leaving Settings → Import Logs right after opening it threw a console error. Nothing was lost, but the error appeared every time.

Cause

The view renders synchronously, then fills its table from IndexedDB in a setTimeout (renders can't be async, CLAUDE.md §15). If you clicked to another view before that finished, #importLogsBody was gone. renderImportLog() then threw Cannot set properties of null (setting 'innerHTML') at views-data.js:215. The bug has been on master since the view was added. I found it while testing #17.

What changed

js/views-data.js:

  • The deferred fill stops if the view has been left. It checks #importLogsBody before the database read, then looks it up again after the read.
  • renderImportLog() returns early when given no container.

Docs and versions: CHANGELOG 1.10.5, the version in index.html, README (2 places) and views-settings.js, plus CLAUDE.md §1 and the last-updated line.

How it was tested

Headless Chromium against samples/. The CDNs are blocked in the sandbox, so the same pinned library versions were served from npm; the SRI hashes match.

  • Stress test: import the samples, then for 6 rounds switch through all 24 views and the 6 Settings tabs with no pause, and also open and leave each view in the same tick.
    • Before: 7 page errors, all this one.
    • After: 0.
    • No other view showed the problem. The Data & Reset counts and the DB Inspector already guard their async fills.
  • Normal use: boot, import 257 transactions, visit every view in light and dark with a short pause, and open the Import Log toggle on the Import tab (13 rows). 0 console or page errors.

Not verified: Safari and Firefox weren't run.

Noticed, not changed: the changelog embedded in views-db.js (the Changelog developer view) stops at v1.4.1. Its comment says to update it whenever CHANGELOG.md changes, but no release since has, so I left it alone.

Please check before merging

  • Open Settings → Import, then immediately click another view: no error in the console.
  • Settings → Import still shows the import log after it loads.

Generated by Claude Code

The Import Logs view fills its table from IndexedDB in a setTimeout after
rendering. Clicking to another view first removed #importLogsBody, and
renderImportLog() threw "Cannot set properties of null (setting 'innerHTML')".
Look the element up again after the database read and stop if it's gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft

@gitluis gitluis left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully reviewed and tested. Approved.

@gitluis
gitluis merged commit e8e18e7 into master Nov 2, 2026
@gitluis
gitluis deleted the fix-import-log-race branch November 2, 2026 11:19
This was referenced Nov 2, 2026
gitluis pushed a commit that referenced this pull request Nov 2, 2026
…ettings-database-tab

Carries master's v1.10.3-v1.10.5 up the stack: declined answers (#14),
literal single "~" (#15) and the Import Logs race fix (#18), with
clarity-insights' port of #14 to the rebuilt AI tab.

One conflict: CLAUDE.md's "Last updated" line. Kept this branch's
line and added the v1.10.3-v1.10.5 history. The CHANGELOG merged cleanly.
Versions stay 1.17.0. renderImportLog() keeps #18's guards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants