Skip to content

Stop the Dropbox status poll from voiding the pending login link - #15135

Merged
omarchybot merged 2 commits into
quattrofrom
fix/issue-12637
Oct 31, 2026
Merged

omarchybot merged 2 commits into
quattrofrom
fix/issue-12637

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

While Dropbox is installed but not linked, the widget's Log in button opens a cli_link_nonce URL, and the status poll then voids it before the user has finished signing in. status.py runs dropbox-cli status every 60 seconds (and every 2 seconds for up to 30 seconds after the shell starts), and dropbox-cli status always calls the daemon's needs_link, which answers an unlinked daemon with a freshly minted nonce each time. A browser sign-in with an account picker or 2FA routinely takes longer than one poll, so the page reports success against a nonce that no longer links anything and the widget stays grey.

While no account is linked, status.py now leaves dropbox-cli status alone and decides whether the daemon is running from ~/.dropbox/dropbox.pid and its /proc entry, the same check dropbox-cli running makes. Its status text is the one the daemon would have given, "Waiting to be linked to a Dropbox account". It still runs on every poll, so the widget notices the link the moment info.json names an account, and from then on it asks the daemon for its status as before, which no longer mints anything because a linked daemon has no link URL to hand out. The condition is the same authenticated that decides whether the panel shows Log in, so the poll stays away from the daemon exactly when that button is reachable.

test/shell.d/dropbox-test.sh runs the helper against a stub dropbox-cli: unlinked, it must not be called whether the daemon is stopped or running; linked, it must be.

Fixes #12637

`dropbox-cli status` asks an unlinked daemon for a link URL every time, and the daemon answers each ask with a fresh nonce, so the widget's poll replaced the URL Log in had just opened while the user was still signing in. While no account is linked, read whether the daemon is running from its pid file instead, the same check dropbox-cli makes.

Fixes #12637
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the earlier non-blocking status-message concern still open.

Findings

  1. P2 Missing folder hides actual status ▶

Summary

Prevents Dropbox status polls from replacing a pending login link.

  • Dropbox status polls leave the pending login link alone.

Reviews (2) · Last reviewed commit: "Cover a stale info.json naming a missing..." · Reviewed by Greptile

Comment on lines +110 to +113
if dropbox_cli and not authenticated:
# `dropbox-cli status` asks an unlinked daemon for a link URL, and each ask voids the one Log in opened.
running = daemon_running()
status_text = "Waiting to be linked to a Dropbox account" if running else "Stopped"

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.

P2 Missing folder hides actual status

If an already-linked account’s sync folder is unavailable, such as when its drive is disconnected, authenticated becomes false. This new branch then skips dropbox-cli status and shows “Waiting to be linked to a Dropbox account” for a running daemon. That misleading message makes the folder problem harder to diagnose.

Choose whether to skip the CLI from the account metadata, separately from whether the folder is available for scanning.

info.json can outlive an unlink, so the poll's guard has to rest on the folder existing, not on info.json naming an account; a guard on the account path alone would bring the nonce rotation back while Log in is showing.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 Oct 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Reviewed and verified at f44aca4. Nothing in the fix needed changing. I added one test case.

Reproduced on a worker built from the Omarchy ISO, with dropbox 274.4.4905-1 and dropbox-cli 2026.09.28-3 installed and the daemon running unlinked. Three dropbox-cli status calls in a row still return three different cli_link_nonce values. With a logging wrapper in front of the real dropbox-cli, status.py from quattro called status on each run and printed a new nonce each time. The head never called the CLI and still reported the daemon running ("Waiting to be linked to a Dropbox account"), and it reported "Stopped" once the daemon was stopped. daemon_running makes the same pid-file and /proc check as dropbox-cli's own is_dropbox_running, and dropbox-cli start still prints the link URL for a running unlinked daemon, so Log in keeps working.

Tests: with the worker's shell serving this branch, test/shell.d/dropbox-test.sh passes 16 of 16 and installed-service-test.sh and tray-test.sh pass. ./test/cli is green. With status.py reverted to quattro, the Dropbox test fails. CI is green.

Pushed: f44aca4 adds a case to dropbox-test.sh where info.json names a sync folder that does not exist: the helper must leave the daemon alone. info.json can outlive an unlink, so the guard has to rest on the folder existing, the same authenticated that shows Log in. With the guard changed to check the account path instead, the new case fails.

Greptile's note on status.py:113 is accurate but minor. If a linked account's folder is unmounted, the IPC status() text reads "Waiting to be linked", but nothing in the panel displays that text. Switching the guard to the account path, as it suggests, would bring the nonce rotation back for a stale info.json, so I left the condition as it is.

The second opinion was Codex Medium, over two rounds. It found no defect, independently of my conclusion only as far as its read-only access to this session allows. It did name the missing-folder test gap that f44aca4 closes. This now waits on the maintainer.

@omarchybot
omarchybot merged commit b628987 into quattro Oct 31, 2026
2 checks passed
omarchybot added a commit to ihoka/omarchy that referenced this pull request Nov 1, 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 added a commit to kvnloo/omarchy that referenced this pull request Nov 1, 2026
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>
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
berenddeboer pushed a commit to berenddeboer/omarchy that referenced this pull request Nov 6, 2026
…com#15135)

* Stop the Dropbox status poll from voiding the pending login link

`dropbox-cli status` asks an unlinked daemon for a link URL every time, and the daemon answers each ask with a fresh nonce, so the widget's poll replaced the URL Log in had just opened while the user was still signing in. While no account is linked, read whether the daemon is running from its pid file instead, the same check dropbox-cli makes.

Fixes omacom#12637

* Cover a stale info.json naming a missing Dropbox folder

info.json can outlive an unlink, so the poll's guard has to rest on the folder existing, not on info.json naming an account; a guard on the account path alone would bring the nonce rotation back while Log in is showing.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Omarchybot <317366263+omarchybot@users.noreply.github.com>
Co-authored-by: Codex Medium <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b628987)
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

Development

Successfully merging this pull request may close these issues.

Dropbox widget's 60s status poll rotates the link nonce, breaking its own Log in button

2 participants