Skip to content

Keep the Dropbox panel polling until the account link completes - #1

Closed
procrypto wants to merge 1 commit into
quattrofrom
fix-dropbox-link-wait
Closed

procrypto wants to merge 1 commit into
quattrofrom
fix-dropbox-link-wait

Conversation

@procrypto

@procrypto procrypto commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

What this is: a fix for the Dropbox bar panel staying on "Login to Dropbox" after you have linked the device in the browser. The panel now keeps checking for the link after a login click, instead of waiting for its 60-second refresh timer. Three files: shell/plugins/panels/dropbox/Service.qml, Panel.qml, and the plugin's test file.

What you see today

  1. Panel shows "Login to Dropbox". You click it.
  2. A Dropbox link page opens in the browser. You connect the device.
  3. Back in the panel: still "Login to Dropbox". It stays that way for up to a minute.

Measured on a stock 4.0.3 install: the link landed at 00:33:54, and the panel was still on the login prompt at 00:34:22. It only updated at 00:34:26 because I clicked Login a second time, which triggers a one-off refresh. Reported as omacom#10940.

Why

Service.qml re-runs status.py on a 60-second timer, when the panel opens, and once, one second after dropbox-cli start exits. Nothing re-runs it because a link is in progress, and the browser step takes longer than one second.

Two facts about the current client (268.4.4124, self-updated from the 264.4.3421 package) shape the fix:

  • An unlinked daemon does not answer its command socket. For the whole unlinked window dropbox-cli status printed "Dropbox isn't running!", and dropbox-cli start printed "Dropbox isn't running!" then "Dropbox is already running!" with no URL. The daemon opens the link page in the browser by itself at startup.
  • So the panel never sees a link URL. Any wait keyed on seeing one, including polling status for it, never starts or times out.

Change

  • After any login attempt, poll status.py every 3 seconds for up to 5 minutes. Stop as soon as a poll reports a linked account.
  • While waiting, the login row reads "Finish linking in your browser". The caption is "Waiting for Dropbox to confirm the link", or "Click to reopen the Dropbox page" when the panel did capture a URL, in which case a click reopens that URL rather than running dropbox-cli start again.
  • If nothing confirms the link within 5 minutes, the panel says so.
  • Six wiring assertions added to test/shell.d/dropbox-test.sh, in the existing node-test style.

Evidence

Same machine, same method for both rounds: stop the daemon, move ~/.dropbox aside so it starts unlinked, trigger the panel's IPC login, connect in the browser tab the daemon opened. A monitor logged the daemon's dropbox-cli status next to the panel's omarchy-shell omarchy.dropbox status every 3 seconds.

Link landed Panel showed linked Gap Needed a second click
Stock 4.0.3 00:33:54 00:34:26 32 s Yes
With this patch 00:42:42 00:42:46 4 s No

Omarchy 4.0.3-1, dropbox 264.4.3421-1, dropbox-cli 2024.04.17-2.1, Hyprland 0.56.2, x86_64.

Also: bash test/shell.d/dropbox-test.sh passes; qmllint on both QML files adds nothing beyond the existing unresolved qs.* imports.

Related

What a second click does

Filed separately as omacom#11954, since it is a dropbox-cli behaviour the panel can only avoid, not fix. The short version, and the other half of why the reopen behaviour matters. dropbox-cli start decides whether the daemon is running from ~/.dropbox/dropbox.pid. With a valid pidfile a second click is harmless: the CLI prints "Dropbox is already running!" and exits. With a stale one it forks a fresh dropboxd into the caller's cgroup. Measured by moving the pidfile aside on a healthy, up-to-date install and running dropbox-cli start from a terminal:

  • A second daemon started within 2 seconds, in the terminal's scope, and took over the pidfile and both command sockets. The unit's daemon kept running.
  • Both ran side by side for the full 2 minutes I watched. The CLI, and so the panel, now talked to the newcomer, which reported "Starting..." the whole time. The original kept syncing, invisible.
  • Killing the stray did not restore things: the pidfile still named the dead process and the CLI reported "Dropbox isn't running!" against a daemon that was up. Only restarting the unit repaired it.

From the panel, that cgroup is Quickshell's (omacom#10423). The pidfile did not go stale during either link round here, so this is a consequence of re-running start at the wrong moment, not of linking itself. It is why a click during the wait reopens the page rather than running start again.

🤖 Generated with Claude Code

After the login button ran dropbox-cli start, nothing watched for the
link to finish. The service refreshed once, a second after the command
exited, and then waited for the periodic timer, up to a minute by
default. The panel sat on "Login to Dropbox" after the browser flow had
succeeded, which invites a second click.

The current client makes this worse: an unlinked daemon does not answer
its command socket, so dropbox-cli start prints no link URL at all. The
daemon opens the account-link page in the browser itself. So the wait
has to start on the click, not on a URL the panel may never see.

Poll every 3 seconds for up to 5 minutes after any login attempt, and
stop as soon as a status poll reports a linked account. While that wait
is pending the login row reads "Finish linking in your browser", and if
a URL was captured a click reopens it instead of starting the flow
over. If the daemon never confirms the link, say so.

Measured on Omarchy 4.0.3 with client 268.4.4124: before, the panel was
still on the login prompt 28 seconds after the link landed; after, it
flipped within 4 seconds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@procrypto

Copy link
Copy Markdown
Owner Author

Superseded by the upstream draft: omacom#11955

@procrypto procrypto closed this Sep 15, 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.

1 participant