Skip to content

fix: code-scanning findings, two bug-hunt rounds and plain wording across the app - #138

Merged
iLevyTate merged 5 commits into
mainfrom
fix/code-scanning-alerts
Nov 16, 2026
Merged

iLevyTate merged 5 commits into
mainfrom
fix/code-scanning-alerts

Conversation

@iLevyTate

Copy link
Copy Markdown
Owner

Four commits on top of v5.3.1: code-scanning fixes, two bug-hunt rounds, the follow-ups those left open, and a plain-wording pass over the app's text. Every behavior fix has a test that fails on the old code.

Security (code scanning)

  • Chat search escapes the LIKE escape character, so a query with a backslash (C:\Users) matches the real text.
  • ConfigurationManager.override refuses __proto__, constructor and prototype path segments.
  • The MCP bearer regex starts the token at a non-space, so a header of spaces cannot backtrack.
  • The preload HTML stripper repeats until stable and accepts closing tags with spaces or junk before >. Script and style end tags match with attributes.
  • platform.js uses fixed separator regexes, in-memory dedup keys use sha256, the e2e orphan cleanup runs without a shell, and the ffmpeg filter path escapes backslashes and colons.
  • mac-release checks out the release tag ref and only restores the npm cache.

Bugs

  • A full search rebuild interrupted by quitting no longer leaves an empty index marked as finished.
  • Triage Organize waits for slow cross-drive moves instead of reporting them failed after 30 s while the file keeps moving.
  • Two empty files are no longer treated as duplicates.
  • On Windows, files on a network share or a drive mapped to one are left in place (NETWORK_NO_RECYCLE_BIN) instead of being deleted permanently, since shares have no Recycle Bin.
  • The stuck-run watchdog and Force reset keep finished results, release the run lock and requeue unfinished files. Before, they wiped every result and left the lock held.
  • After an embedding model change, queued vectors from the old model are dropped instead of written into the new index.
  • Search spelling correction never corrects a word that occurs in the indexed files, and a corrected search offers "Search for instead".
  • The startup learning scan keeps its own record, so it no longer stops once feedback history fills up.
  • Restoring the oldest settings backup keeps it. Wrong-size or non-finite vectors fail only themselves, not the batch.
  • Fallback names keep compound archive extensions (.tar.gz, .tar.xz).
  • Also: model downloads, the setup wizard, AI status, MCP port fallback and its errors, the chat scope limit, renaming nested smart folders, macOS Unicode file names and case-only rename resume.

Wording

  • No em or en dashes in user-visible text. Ranges read "X to Y".
  • "Please" and filler removed from error and toast messages. Meaning, numbers and feature names are unchanged.
  • Messages point at Settings sections that exist (Model management, Default AI models, Local AI engine, AI Provider). "Settings > Models", "Settings > AI" and "Settings > Advanced" did not exist.
  • Semantic IPC errors name the feature ("The search index isn't ready yet") instead of internal service names.
  • Phrases code matches on ("Vector DB", "invalid characters", "Another batch operation is already in progress") are kept. Logs, model prompts and code comments are unchanged.

Checks (local, Windows 11 x64, Node 24.22.2)

  • Full Jest suite with coverage in 80-file chunks, merged: all coverage thresholds met. The 101 suites touched by the wording pass were rerun after the last change: 1187 of 1187 passed.
  • format:check, lint, typecheck, typecheck:js, audit:production, audit:bundled, compliance:commercial:verify (inventory unchanged), every verify:* step in npm run ci, generate:channels:check, knip:files and build all pass.
  • Not run: the Playwright e2e specs, a packaged build, and macOS.

Notes for review

  • CHANGELOG [Unreleased] is empty. Entries are needed before the next release.
  • Copy decisions worth a look: a few lines were shortened (Organize lead and heading, the Complete card), and the Atlas hint uses British spelling ("neighbours", "colour").

…erride, MCP auth and the preload stripper

- Chat search escapes the LIKE escape character, so a query with a
  backslash (C:\Users) matches the real text.
- ConfigurationManager.override refuses __proto__, constructor and
  prototype path segments.
- The MCP bearer regex starts the token at a non-space, so a header of
  spaces cannot backtrack.
- The preload HTML stripper repeats until stable and accepts closing tags
  with spaces or junk before '>'.
- platform.js uses fixed separator regexes; in-memory dedup keys use
  sha256; the e2e orphan cleanup runs without a shell.
… and lifecycle

Two bug hunts over the app plus a review of the first round's own fixes.
Every fix comes with a test that fails on the old code.

Highlights:
- A full search rebuild interrupted by quitting no longer leaves an empty
  index marked as finished; the interrupted flag stays set for next launch.
- Triage Organize waits for slow cross-drive moves instead of reporting
  them failed after 30 s while the file keeps moving.
- Two empty files are no longer treated as duplicates.
- Search spelling correction leaves real words alone and still searches
  the word as typed.
- The startup learning scan keeps its own record of what it learned, so it
  no longer stops once feedback history fills up.
- Go to Home after a screen error stops a running analysis.
- Restoring the oldest settings backup keeps it; rotation still holds the
  limit and drops the oldest other backup instead.
- Wrong-size or non-finite vectors fail only themselves, not the batch.
- Model downloads, setup wizard, AI status, MCP port fallback and error
  messages, chat scope limit, smart folder rename of nested folders,
  macOS Unicode file names, case-only rename resume, and more.
…e positives

Trash on network drives
- Windows keeps no Recycle Bin on a share or a drive mapped to one, so
  TrashService now leaves those files in place with NETWORK_NO_RECYCLE_BIN
  instead of letting trashItem delete them permanently. realpath resolves a
  mapped drive to its share path.
- Duplicate cleanup accepts share paths (still refusing admin shares, device
  paths and traversal) and reports which files were left on a network drive.

Analysis runs
- The stuck-run watchdog and Force reset used the Redux reset, which wiped
  every finished result and left the run lock held. Both now use the run
  reset, which keeps results and requeues unfinished files.

Names
- The fallback name keeps a compound archive extension (.tar.gz, .tar.xz)
  when given only its last part.

Embeddings
- After an embedding model change, queued vectors from the old model are
  dropped instead of being written into the new index. Quantizations of the
  same model still count as the same model.

Search spelling correction
- A word that occurs in the indexed files is never corrected, and a
  correction that occurs in the index is preferred.
- A corrected search offers "Search for <original> instead".

Code scanning
- mac-release checks out the release tag ref and only restores the npm cache.
- Script and style end tags match with attributes, HTML tag stripping repeats
  until stable, and the ffmpeg filter path escapes backslashes and colons.

Housekeeping
- Remove two unused constants from compose-walkthrough-media.
- Give the three-service restore-worker parity test a 30 s timeout; it takes
  about 1.5 s alone but passed 10 s on a loaded machine.
- Remove em and en dashes from user-visible text in the renderer and in
  main-process messages that reach the UI. Number and date ranges read
  "X to Y". Lone placeholders for empty values stay.
- Drop "Please" from error and toast messages, and cut filler ("Ask me
  anything", "streamlined", "with confidence"). Meaning, numbers and
  feature names are unchanged.
- Point messages at Settings sections that exist: Model management for
  downloads, Default AI models for picking a model, Local AI engine when
  the engine is down, AI Provider for cloud providers. "Settings > Models",
  "Settings > AI" and "Settings > Advanced" did not exist.
- Semantic IPC errors name the feature ("The search index isn't ready yet")
  instead of internal service names.
- Text that code matches on ("Vector DB", "invalid characters", "Another
  batch operation is already in progress") keeps those phrases.
- Log lines, prompts sent to the model, entity tables and code comments are
  unchanged.
…form

On Linux a Windows path is not absolute, so the settings sanitizer drops
it and auto-recovery returned no defaultSmartFolderLocation. The app is
right: Electron never reports a Windows path there. The mock now matches
the platform, which fixes the ci (ubuntu-latest) failure on this branch.
@iLevyTate
iLevyTate merged commit 71d1e93 into main Nov 16, 2026
8 checks passed
@iLevyTate
iLevyTate deleted the fix/code-scanning-alerts branch November 16, 2026 21:03
@iLevyTate iLevyTate mentioned this pull request Nov 16, 2026
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.

1 participant