Skip to content

Hotfix - #9

Merged
Hermesiss merged 2 commits into
mainfrom
develop
Jul 6, 2025
Merged

Hotfix#9
Hermesiss merged 2 commits into
mainfrom
develop

Conversation

@Hermesiss

Copy link
Copy Markdown
Owner

No description provided.

@Hermesiss
Hermesiss requested a review from Copilot July 6, 2025 21:05
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
44.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This hotfix adds support for injecting the Electron userData path into background workers by introducing a setUserDataPath API, refactors file utility usage, cleans up a leftover debug log, updates tests, and bumps the version.

  • Introduce setUserDataPath in fileUtils and remove direct app dependency.
  • Extend WorkerMessage and propagate userDataPath from main.ts into both scan workers.
  • Remove stray console.log in appDataCleaner, update tests for the new API, and bump version.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/types/developer-cleaner.ts Adjust WorkerMessage to include userDataPath
src/main/main.ts Call setUserDataPath early and pass it to workers
src/main/fileUtils.ts Add setUserDataPath, guard path usage, remove app
src/main/developerScanWorker.ts Switch to fileUtils import and apply userDataPath
src/main/appDataScanWorker.ts Refactor imports, wire userDataPath into scanner
src/main/appDataCleaner.ts Remove debug console.log
src/main/tests Update tests to call setUserDataPath and adapt mocks
package.json Bump version to 1.2.6
Comments suppressed due to low confidence (4)

src/main/fileUtils.ts:8

  • [nitpick] The parameter path shadows the imported path module. Consider renaming the parameter to dataPath or userDataDir for clarity and to avoid confusion.
export function setUserDataPath(path: string) {

src/main/tests/fileUtils.test.ts:40

  • Add a test case that verifies getSavedFoldersPath() and getSavedDeveloperProjectsPath() throw or error when setUserDataPath has not been called, to cover the new error branch.
    setUserDataPath(mockUserDataPath);

src/main/tests/appDataScanWorker.test.ts:17

  • The tests mock setUserDataPath but never assert it was called with message.userDataPath. Consider adding an assertion to verify the worker invokes fileUtils.setUserDataPath with the correct argument.
  setUserDataPath: vi.fn()

src/types/developer-cleaner.ts:34

  • The WorkerMessage type was changed to only allow "stop" and made optional, removing the "scan" variant; this will break message dispatching. It should include both "scan" and "stop" (e.g., type: "scan" | "stop";) while making type optional only if intended.
  type?: "stop";

@Hermesiss
Hermesiss merged commit 509f396 into main Jul 6, 2025
12 of 14 checks passed
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