Skip to content

Stop Dropbox panel inventing quota from plan name - #12974

Open
kvnloo wants to merge 4 commits into
omacom:quattrofrom
kvnloo:fix/12638-no-hardcoded-plan-quotas
Open

kvnloo wants to merge 4 commits into
omacom:quattrofrom
kvnloo:fix/12638-no-hardcoded-plan-quotas

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What

Remove the hardcoded PLAN_QUOTAS table from the Dropbox panel status helper. Until real quota data is available, emit quotaBytes: 0, usagePercent: 0, and quotaKnown: false.

Why

subscription_type does not determine storage quota (referral/bonus/legacy space). Looking up Basic → 2 GB produced impossible figures like 1172% / "23.44 GB of 2 GB". The panel already renders used-only text when quotaKnown is false.

Tests

bash test/shell.d/dropbox-test.sh — existing model helpers plus a regression that runs status.py against a fake Basic info.json and asserts unknown quota / no PLAN_QUOTAS.

Fixes #12638

Fixes #7597

PLAN_QUOTAS guessed Basic at 2 GB and produced >100% usage when
referral/bonus space exceeded that floor. Emit quotaBytes 0 /
quotaKnown false until real quota data exists.
@llstrk

llstrk commented Sep 23, 2026

Copy link
Copy Markdown

Verified: No substantive issue found in the reviewed scope at 052e3925. The helper now reports unknown quota instead of deriving a storage limit from the plan name, while retaining the locally scanned used size.

Synthetic Basic account, 2.5 GB sparse file plus a six-byte file:

Output Base PR
quotaBytes / quotaKnown 2000000000 / true 0 / false
usagePercent 125.0000003 0
“Stored” text from the real Model.js 2.5 GB of 2 GB 2.5 GB

The existing panel calls that model function. The percentage above is helper output, not a claim that the current panel displays it. The new regression test passes on head and fails at its quota assertion when run against the baseline helper.


Review information

Test scope: Isolated synthetic accounts exercised the real Python helper and JavaScript formatter, including CLI-absent and stubbed-CLI paths. QML integration was source-inspected, not visually rendered. No real Dropbox account, daemon or remote quota was tested. Used bytes remain a local folder measurement, not total cloud usage.

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

Automated AI review: Astra Medium initial inspection and synthesis, independent Opus 5.5 High and GPT 6 Sol Xhigh technical reviews, followed by verification against targeted evidence and a fresh Astra Medium editorial check.

@sanjyay

sanjyay commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Tested in the Omarchy VM running Omarchy 4.0.4-1 with Python 3.14.7 and Quickshell 0.3.1:

  • Ran bash test/shell.d/dropbox-test.sh: all 13 tests passed, including the new regression test verifying that status.py emits unknown quota instead of deriving limits from the hardcoded PLAN_QUOTAS table.
  • Verified status.py output against various plan names (Basic, Plus, Professional, and custom tiers):
    • Emits quotaBytes: 0, quotaKnown: false, and usagePercent: 0.
    • Accurately tracks locally scanned usedBytes.
  • Verified formatting through Model.usageText():
    • Formats cleanly as stored usage only (e.g. 25.2 GB) rather than appending an invented ceiling (such as 25.2 GB of 2 GB on Basic accounts with referral/promotional storage).

Behavior is clean and verified with no regressions.

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

Copy link
Copy Markdown
Collaborator

Reviewed at 052e3925 and verified on a disposable Omarchy worker. Nothing found to change.

Reproduction. I set up a fake Basic account holding a 2.5 GB file and ran status.py against it, then passed the output through the panel's own Model.usageText(). On current quattro (821ae589) the helper reports quotaKnown: true, quotaBytes: 2000000000 and usagePercent: 125, and the Stored line reads "2.5 GB of 2 GB". On this head it reports the quota as unknown, keeps usedBytes: 2500000000, and the Stored line reads "2.5 GB". Restoring the old status.py on top of this branch brings the wrong figure back. Your new test in dropbox-test.sh fails on quattro and passes here, as it should.

Tests on the worker. ./test/cli and test/shell.d/dropbox-test.sh (14 of 14) pass.

Scope. The change is proportionate. It deletes the table and keeps the output shape. Every reader of these fields (Service.qml, Model.js, Panel.qml:307) already handles an unknown quota, and nothing in the panel draws usagePercent. Users on Plus or Pro plans lose a denominator that happened to look right. But paid plans earn bonus space too, so the table was only a guess for them as well.

Second opinion. Codex Medium reviewed the same diff and found no defect. It reached the same view on proportionality and on the consumers; independence is not guaranteed. It also pointed out that /usr/bin in the test's PATH still exposes a system dropbox-cli. That doesn't affect the result, because the test never asserts on installed or the status text.

Overlap with other open PRs. #12781 and #11436 add a quotaGB override that falls back to PLAN_QUOTAS when unset. Whichever lands second has to be reconciled with this one: the fallback should become "unknown", or it would either reference a deleted name or bring the bug back. #12780, #12988 and #9191 edit nearby lines in status.py or the end of the test file, so they may need a rebase.

This fixes #12638. It is waiting on the maintainer.

quattro grew its own status.py fixture in dropbox-test.sh (omacom#15135), so the regression now uses that fixture instead of a second temp dir and EXIT trap, and drops the assertion that grepped status.py for PLAN_QUOTAS, which the repository's testing rules forbid. The file keeps quattro's 100644 mode.

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

[Low impact] The PR appears safe to merge.

Summary

Stops the Dropbox panel from guessing storage quota from the plan name.

  • Dropbox storage details stop treating plan names as quota limits.

Reviews (3) · Last reviewed commit: "Merge quattro into fix/12638-no-hardcode..." · Reviewed by Greptile

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

Copy link
Copy Markdown
Collaborator

This had stopped merging cleanly: #15135 added a status.py fixture to the end of test/shell.d/dropbox-test.sh on quattro, right where your regression went. I merged quattro into your branch (9d091a1) and moved your regression onto that fixture, so it no longer sets up its own temp directory and EXIT trap. Your status.py change is untouched. Two small things went with the move: the assertion that grepped status.py for PLAN_QUOTAS is gone, because the repository's testing rules in AGENTS.md ask tests not to grep the source, and the file is back to quattro's 100644 mode.

Re-verified on a disposable Omarchy worker at 9d091a1. ./test/cli passed, and so did test/shell.d/dropbox-test.sh (21 of 21). With quattro's status.py swapped back in, the regression fails: a Basic account gets quotaBytes: 2000000000 and quotaKnown: true. I also opened the panel itself with the shell linked to each tree, using a fake Basic account holding 2.5 GB. Only the Stored line is under test here. The status line under the title changes from one capture to the next on both trees.

Before, on quattro: Stored reads 2.5 GB of 2 GB for a Basic account
After, on this branch: Stored reads 2.5 GB

Second opinion. Codex Medium and muse-wonder via pi (thinking high) reviewed the merged change: the conflict resolution, whether the regression fails on quattro and passes here, the consumers of the quota fields, and proportionality. Neither found a defect. They agree with my reading, and that agreement is not guaranteed to be independent.

CI is green at this head. This fixes #12638 and #7597, and it is waiting on the maintainer. My earlier note still applies to #12781 and #11436: they fall back to PLAN_QUOTAS, so whichever one lands after this one will need reconciling.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Nov 11, 2026
quattro's --status-only fast path landed on the same lines as this branch's removal of the plan-quota math, and its Dropbox metadata exclusion test was appended where this branch's regression sits. Keep the status-only scan without the usage_percent line, and run the plan-quota regression after the exclusion test so its extra file does not disturb that test's exact byte count.
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge and removed verified Omarchy Triage has verified that this issue is ready for final review labels Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This had stopped merging cleanly again. quattro has since added a --status-only fast path to status.py on the same lines where your change drops the quota math, and a test for skipping Dropbox's internal metadata at the end of test/shell.d/dropbox-test.sh, right where your regression sits. I merged quattro into your branch (7b25510). In status.py I kept the status-only scan and left out the usage_percent line your change removes. In the test file your regression now runs after the new metadata test. That test checks an exact byte count, and the note.txt your block writes would throw it off. Against quattro, the branch still makes exactly your change.

Re-verified on a disposable Omarchy worker at 7b25510. ./test/cli passed, and so did test/shell.d/dropbox-test.sh (41 of 41) with the shell linked to the branch. With quattro's status.py swapped back in, your regression fails: a Basic account gets quotaBytes: 2000000000 and quotaKnown: true. I didn't take new screenshots. The panel's Stored line is still drawn by the same Model.usageText from the same fields, so the before and after in my previous comment still show what this changes. CI is green at this head.

Second opinion. Codex Medium and muse-wonder via pi (thinking high) reviewed the merge: the conflict resolution, how Service.qml, Model.js and Panel.qml handle the zeroed fields (including status-only refreshes, which leave the stored values alone), the test order, and proportionality. Neither found a defect. They agree with my reading, and that agreement is not guaranteed to be independent.

This fixes #12638 and #7597, and it is waiting on the maintainer. #12781 and #11436 are still open and still fall back to PLAN_QUOTAS, so whichever of them lands after this one will need reconciling.

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

kvnloo commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Merged quattro (cdd18b2) into this branch as 96080da, a normal merge with both parents. Nothing was rebased.

Conflict: test/shell.d/dropbox-test.sh, which 0fae8e6 (#19904, "Speed up test suite") deleted while this PR extended it. Resolution: kept the deletion, so the PR is now only the status.py change.

Tests, all run on a fresh Linux box. The test file was deleted upstream, so I ran this PR's previous version of it out of tree:

  • On plain quattro: 40 ok, then not ok - dropbox status does not derive a quota from the plan name. That status still reports quotaBytes: 2000000000, quotaKnown: true for a Basic account.
  • At the merge: 41 ok, 0 failures.

Prepared by Claude Opus 5.5 via Hermes Agent; reviewed under kvnloo's account.

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

Copy link
Copy Markdown
Collaborator

Re-verified 96080da4 after your merge. No defect found. On a disposable Omarchy worker linked to this head, ./test/cli passed all 141 checks. Since quattro removed dropbox-test.sh, I used a separate fixture running the real helper and Model.usageText(): Basic, Plus and Professional accounts get guessed quotas on the base, unknown quotas on this head, and guessed quotas again with the base helper restored. Local byte counts and file rows are preserved; the status-only path still skips the scan, and its consumer preserves the previous full-refresh totals.

The live panel below uses a synthetic Basic account holding a 2.5 GB sparse file. These captures establish the Stored line's behavior, without testing a real Dropbox account or cloud-side usage. Restoring the head after the base capture returns the panel to “2.5 GB”. The worker has been destroyed.

Before: the base helper makes Stored read 2.5 GB of 2 GB
After: this head makes Stored read 2.5 GB

GPT-6 in Codex (reasoning effort not exposed) reviewed the change, and Opus 5.5 High and muse-wonder via pi (thinking high) gave the second opinion on this head. Both found no defect and agreed that the field consumers already handle an unknown quota; that agreement is not guaranteed to be independent. CI passes, and Greptile scores this head 5/5 with no findings. This fixes #12638 and #7597 and waits on the maintainer. The earlier note about reconciling the optional quota overrides in #11436 and #12781 still applies.

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

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

4 participants