Skip to content

Let the Dropbox widget be told the account's real quota - #7600

Closed
srikat wants to merge 1 commit into
omacom:quattrofrom
srikat:dropbox-quota-override
Closed

srikat wants to merge 1 commit into
omacom:quattrofrom
srikat:dropbox-quota-override

Conversation

@srikat

@srikat srikat commented Aug 20, 2026

Copy link
Copy Markdown

Fixes #7597.

PLAN_QUOTAS in the Dropbox widget's status.py maps subscription_type to the space a plan ships with, but that is only where an account starts. Referral bonuses on Basic (500 MB each, up to 16 GB, permanent) and storage add-ons on the paid tiers raise the real quota while subscription_type still reads "Basic". My own account is 1.53 GB of 21.38 GB and the widget rendered it as 1.64 GB of 2 GB — ~82% full instead of ~7%.

The authoritative number lives behind the Dropbox API (/2/users/get_space_usage), which needs an OAuth token the widget has no way to ask for, and neither dropbox-cli nor ~/.dropbox/info.json exposes it. So rather than guess better, this lets the affected account state the figure:

  • manifest.json gains a quotaOverrideMB integer setting, defaulting to 0.
  • Service.qml reads it and passes it to the helper.
  • status.py gains quota_override_bytes(); the override wins when usable, and anything else — zero, negative, blank, non-numeric — falls back to PLAN_QUOTAS untouched.

Megabytes rather than bytes because a real quota in bytes overflows a QML int.

Default behavior is unchanged: with the setting absent or 0, the plan lookup runs exactly as before.

Before / after

Same account, before and after setting quotaOverrideMB to 21380:

Before 1.64 GB of 2 GB
After 1.64 GB of 21.4 GB

(Screenshots attached below.)

Tests

Extended test/shell.d/dropbox-test.sh with coverage for the override reader — megabyte conversion plus each way a setting can be unusable. ./test/shell passes; the three failures in ./test/all on my machine are all omarchy-pkgs checkout not found and unrelated to this change.

Verified in the running UI on Omarchy 4.0.0-1 via a cloned copy of the plugin.

Notes

Two things I deliberately left out, happy to fold in either if you'd rather:

  • Manual docs. manual/24-commercial-apps-services.md covers Dropbox setup but no widget settings, so I left it alone rather than start that section here.
  • usedBytes accuracy. scan_dropbox() walks the sync folder rather than reading Dropbox, so it understates usage under selective sync (and slightly overstates here by counting .dropbox.cache). Same root cause — no API access — but a separate change.

PLAN_QUOTAS maps subscription_type to the space a plan ships with, but that
is only where an account starts. Referral bonuses on Basic and storage
add-ons on the paid tiers raise the real quota permanently while
subscription_type still reads "Basic", so a long-standing Basic account
renders as nearly full when it is nearly empty.

The true figure lives behind the Dropbox API, which needs an OAuth token the
widget has no way to ask for, so add a quotaOverrideMB setting that lets
affected accounts state it. Zero keeps the existing plan lookup. Megabytes,
because a quota in bytes overflows a QML int.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012XAr19kW1bU8LyxkL1iz6F
Copilot AI balanced review requested due to automatic review settings August 20, 2026 09:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a configurable Dropbox storage quota override for accounts with bonuses or add-ons.

Changes:

  • Adds the quotaOverrideMB widget setting.
  • Applies valid overrides while preserving plan defaults.
  • Tests conversion and invalid-value fallback behavior.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
shell/plugins/panels/dropbox/manifest.json Defines the quota setting.
shell/plugins/panels/dropbox/Service.qml Passes the configured quota to the helper.
shell/plugins/panels/dropbox/status.py Validates and applies quota overrides.
test/shell.d/dropbox-test.sh Covers conversion and fallback cases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

local actual

actual=$(read_override "$raw")
[[ $actual == "$expected" ]] || fail "$description" "expected $expected, got $actual"
@bjarneo

bjarneo commented Sep 21, 2026

Copy link
Copy Markdown
Member

Automated duplication check: this pull request looks similar to #11436, which covers the same Dropbox quota override. I keep that one open and close this one to consolidate review.

If you feel this is the wrong decision, please open the PR again with a note on the difference.

@bjarneo bjarneo closed this Sep 21, 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.

Dropbox widget shows wrong quota for Basic accounts with bonus space

3 participants