Skip to content

Exclude Dropbox's internal directories from the widget scan - #12780

Open
ihoka wants to merge 2 commits into
omacom:quattrofrom
ihoka:dropbox-exclude-internal-cache
Open

ihoka wants to merge 2 commits into
omacom:quattrofrom
ihoka:dropbox-exclude-internal-cache

Conversation

@ihoka

@ihoka ihoka commented Sep 21, 2026

Copy link
Copy Markdown

The Dropbox widget walks the whole account folder to build its recent-files list and usage total. That walk includes .dropbox.cache, where Dropbox stages every file it downloads, and the .dropbox metadata file.

Staged files are written as the sync runs, so they hold the newest mtimes and crowd real files out of "Recent files" entirely — the panel shows a list of opaque cache hashes while syncing. Their bytes also land in the usage total, which on a large first sync overstates it by tens of gigabytes.

Skip both entries at the root of the account folder.

The Dropbox widget walks the whole account folder to build its recent-files
list and usage total. That walk includes .dropbox.cache, where Dropbox stages
every file it downloads, and the .dropbox metadata file.

Staged files are written as the sync runs, so they hold the newest mtimes and
crowd real files out of "Recent files" entirely — the panel shows a list of
opaque cache hashes while syncing. Their bytes also land in the usage total,
which on a large first sync overstates it by tens of gigabytes.

Skip both entries at the root of the account folder.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@llstrk

llstrk commented Sep 21, 2026

Copy link
Copy Markdown

Verified: At b31a6ec18119257ec23c26ec8ffdc024ad07665c, the scanner excludes root .dropbox and .dropbox.cache entries from recent files and usage. No actionable issue was found in the tested scope.

Synthetic fixture: a 5-byte user note, 8-byte root metadata file, and newer 4096-byte staging file:

Helper output Merge-base PR head
usedBytes 4109 5
Most recent file, limit 1 Cache staging file User note
Cache subtree Traversed Pruned

Verified: The complete Dropbox shell test passes on head; the head test run against merge-base production code fails at the new file-list assertion. Additional cases preserve nested same-name entries, near-match names, ordinary files, and existing symlink exclusions.


Review information

Test scope: Production Python helper and focused shell test with synthetic local files. Dropbox CLI absent or stubbed. No live account, sync, rendered-panel, or large-account performance validation.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra performed initial inspection, followed by independent Fable 5.1 and separate Astra reviews. The final assessment reconciles both reports and verifies claims against targeted source and runtime evidence.

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at b31a6ec against quattro, and the fix holds. I found nothing to change.

Reproduced on a worker (a VM built from the Omarchy ISO, with the shell linked to this branch). I used a synthetic account folder of my own: a user file, a root .dropbox file, a newer 100 KB staging file under the root .dropbox.cache, plus a nested Docs/.dropbox.cache/ and a near-match .dropbox.cacheish/ that both belong to the user. On quattro, status.py lists the staging file and .dropbox as the most recent files and reports 100018 bytes used. On this head it reports the 10 bytes of user files, and it keeps the nested and near-match entries. The new checks in test/shell.d/dropbox-test.sh pass on this head and fail again when quattro's status.py is put back. ./test/cli is green.

Not run: the Node block at the top of dropbox-test.sh needs node, which the worker does not have, so the file as a whole exits at that check whatever this branch does. Only the new Python checks were run on their own. No live Dropbox account or sync was exercised.

The diff is the size of the problem: one root-level filter in scan_dropbox and a test. I found no open issue or competing pull request for this.

Reviewed by Claude Opus 5.5. The second opinion (Codex Medium) did not run, because today's review budget was spent. So this has been checked by one model only, and it waits on that review before the maintainer sees it as ready.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
quattro's Dropbox status tests (omacom#15135) landed in the same place as this branch's scan checks. Keep both, and run the scan checks through the shared dropbox_status helper and its temporary home so the file has one EXIT trap instead of two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 1, 2026
@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Excludes root-level .dropbox and .dropbox.cache entries from the Dropbox widget’s recent files and usage total.

  • The Dropbox panel skips its root-level cache and metadata entries.

Reviews (1) · Last reviewed commit: "Merge quattro into dropbox-exclude-inter..." · Reviewed by Greptile

@omarchybot omarchybot added the ready Good to merge label Nov 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had stopped merging cleanly into quattro, so I merged quattro into it and pushed the result as 3cab55fd. The only conflict was at the end of test/shell.d/dropbox-test.sh, where quattro's Dropbox status checks (#15135) landed in the same place as yours. I kept both. Your three checks now run through the existing dropbox_status helper and its temporary home, so the file has one EXIT trap. A second trap would have replaced the first, leaving the fake daemon running and its temp tree behind. status.py merged without changes.

Re-verified at 3cab55fd on a worker (a VM built from the Omarchy ISO, with the shell linked to this branch). I installed node on the worker this time, so the whole of dropbox-test.sh ran: 23 of 23 checks pass. With quattro's status.py swapped in, "dropbox lists only user files" fails because the staging file and .dropbox are both listed and 4109 bytes are reported. It passes again once your version is restored. A separate probe confirmed that a nested Docs/.dropbox.cache/ and a near-match .dropbox.cacheish/ are still counted, and that the filter still applies when info.json gives the path with a trailing slash. ./test/cli is green. I didn't take a screenshot of the panel, since it renders whatever status.py prints, and I didn't exercise a live Dropbox account.

Related: #9191 is older and mainly makes a team account scan its root_path. It also skips .dropbox.cache directories at every depth. For this bug, this PR covers more: #9191 still counts and lists the root .dropbox file, and it hides a user folder named .dropbox.cache anywhere in the tree. The team-root change in #9191 doesn't overlap with this one. If both are merged, scan_dropbox will conflict textually. The fix is to keep #9191's root_path and this PR's root-only filter. Your root == path check still holds there, because it compares against whatever path is walked.

Reviewed by Claude Opus 5.5, with second opinions from Codex Medium and muse-wonder via pi (thinking high). Neither found a defect, and both judged the problem real and the change proportionate. Both also preferred this PR over #9191 for this bug, for the reason above. They were given the question without my answer, but their independence isn't guaranteed. This now waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Nov 11, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

quattro already fixes this, so the PR has nothing left to fix and isn't being brought forward again.

Since the last review, quattro gained 50f57c7 and f41c4ab. In scan_dropbox, they skip .dropbox and .dropbox.cache at the root of the account folder, both files and directories, which is the rule this PR adds, and they add a test for it. That is also why the branch now conflicts in shell/plugins/panels/dropbox/status.py and test/shell.d/dropbox-test.sh.

What was checked: on a fresh Omarchy worker, this PR's three test assertions were added to quattro's test/shell.d/dropbox-test.sh at 3b36b9e. They all pass against quattro's status.py unchanged (43 passed, 0 failed). The same test file fails against the pre-fix status.py from 7eedd17. As a second opinion, Codex Medium and muse-wonder (via pi, thinking high) compared the two implementations. Neither found a difference in what the scan returns: the same names, excluded only at the root, with the same handling of symlinks and of paths with a trailing slash. They agreed with my own reading, so their agreement is not guaranteed to be independent.

The one thing this PR still adds is a test case. Its test keeps a file inside a subfolder (Documents/notes.txt), while quattro's test only puts files at the root. That checks folder traversal in general rather than this bug.

This now waits on the maintainer, with the recommendation to close it as fixed on quattro. Thanks to @ihoka for finding and fixing this first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants