Fix quarantine dir re-scan and phantom runId on empty removal set#6
Conversation
Co-authored-by: Therosin <747653+Therosin@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Fixes two quarantine-mode edge cases in the core cleaning logic: previously quarantined content could be re-discovered by subsequent scans/clean runs, and a quarantine runId could be returned even when no files were quarantined (leading to a non-existent directory reference).
Changes:
- Export
QUARANTINE_DIRand use it in quarantine path creation. - Update
walkFiles()to skip traversing the quarantine directory so quarantined files are excluded from scanning/keeplist generation. - Add tests covering (a) undefined
quarantineRunIdwhen nothing is removable and (b) exclusion of pre-existing quarantine contents from scans.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| logic.ts | Adds QUARANTINE_DIR, skips quarantine folder during traversal, and returns undefined from quarantining when there’s nothing to move. |
| logic_test.ts | Adds regression tests for empty quarantine and for excluding quarantine contents from listRelativeFiles/buildScanPlan. |
| deno.lock | Rewrites the lockfile format/content (currently appears inconsistent with the repo’s import map/dependency set). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const KEEPLIST_FILE = "#keeplist.txt"; | ||
| export const QUARANTINE_DIR = ".modcleaner_quarantine"; | ||
| export const GENERATED_KEEPLIST_HEADER = [ |
There was a problem hiding this comment.
PR description says QUARANTINE_DIR is used consistently “in place of inline strings”, but there are still hard-coded .modcleaner_quarantine string references elsewhere in the repo (e.g. main.ts UI text and an existing test path). Either update those remaining references to use QUARANTINE_DIR (where appropriate) or adjust the PR description to reflect the actual scope of the change.
There was a problem hiding this comment.
@copilot apply changes based on this feedback
make sure you are using deno v2 and that the lockfile is regenerated cleanly.
There was a problem hiding this comment.
Done in commit 3b919ce. All four hardcoded .modcleaner_quarantine references in main.ts (HTML help text, inline JS help string, confirmation message, and status summary) now use ${QUARANTINE_DIR} via the template literal, and QUARANTINE_DIR is added to the import. The logic_test.ts path also uses QUARANTINE_DIR. The lockfile was regenerated cleanly with Deno v2.7.1. All 47 tests pass.
… lockfile Co-authored-by: Therosin <747653+Therosin@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
.modcleaner_quarantinestrings inmain.tswith${QUARANTINE_DIR}(4 occurrences: HTML template, inline JS, confirmation message, status summary)QUARANTINE_DIRto the import inmain.ts.modcleaner_quarantineinlogic_test.tswithQUARANTINE_DIRdeno.lockcleanly with Deno v2.7.1✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.