Skip to content

fix(desktop): ask signed-out Macs to sign in instead of loading earnings forever - #1460

Merged
jonathan308 merged 1 commit into
codex/desktop-mac-preview-20261012from
fix/desktop-earnings-signed-out
Oct 15, 2026
Merged

jonathan308 merged 1 commit into
codex/desktop-mac-preview-20261012from
fix/desktop-earnings-signed-out

Conversation

@jonathan308

@jonathan308 jonathan308 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

useInsights only reads earnings when account.signed_in || account.legacy_data; otherwise its key is empty and nothing is requested. The three views that render its result chose their message from state.linked instead:

View Message when linked but signed out
Earnings Earnings insights · Loading settled earnings… (no Try again)
Home → daily earnings Loading…
Models → Most earned Loading…

Sign-out (DesktopAccountActions.swift) clears the dashboard session but not the provider link (AuthTokenStore), and the dashboard session also expires after 30 days. In both cases, linked: true together with account: { signed_in: false, legacy_data: false } left these views loading forever.

Reproduction: render Earnings with linked: true and account: { signed_in: false, legacy_data: false }. Before: Loading settled earnings…. After: Sign in to see earnings · Sign in to your Darkbloom account from the sidebar to load settled earnings. A signed-in account still shows loading while it reads.

Found during a desktop UI audit. Base: codex/desktop-mac-preview-20261012 (unmerged desktop stack: #1354 plus the signed preview packaging commits). The diff contains only this fix. The Desktop / frontend check on this base also needs #1455.

Before / After

flowchart LR
  subgraph Before["Before"]
    direction TB
    B1(["Sign out / session expires<br/>(link kept)"]):::user --> B2["useInsights: key '' → no read"]:::code
    B2 --> B3["view checks linked → true"]:::bad
    B3 --> B4(["'Loading settled earnings…' forever"]):::bad
  end
  subgraph After["After"]
    direction TB
    A1(["Sign out / session expires<br/>(link kept)"]):::user --> A2["useInsights: key '' → available false"]:::fix
    A2 --> A3["view checks linked, then available"]:::fix
    A3 --> A4(["'Sign in to see earnings'"]):::good
  end
  classDef user fill:#1f2937,stroke:#93c5fd,color:#f9fafb
  classDef code fill:#312e81,stroke:#a5b4fc,color:#eef2ff
  classDef bad fill:#7f1d1d,stroke:#fca5a5,color:#fef2f2
  classDef fix fill:#065f46,stroke:#6ee7b7,color:#ecfdf5
  classDef good fill:#14532d,stroke:#86efac,color:#f0fdf4
Loading

Legend: blue = user action, indigo = unchanged code path, red = defect, green = changed code / fixed outcome.

Changes

  • features/insights/useInsights.ts: returns available, which is true exactly when it will read earnings.
  • features/Earnings.tsx, features/home/FleetEarnings.tsx, features/models/ModelEarnings.tsx and Models.tsx: tell signing in apart from loading.
  • tests/earningsSignedOut.test.tsx: uses the real hook, so the hook and view are tested together. The signed-out case fails on the base branch, and signed-in still shows loading.
  • CHANGELOG.md: Unreleased entry.

Validation

cd desktop-app
npx vitest run tests/earningsSignedOut.test.tsx   # signed-out test fails on base; 2/2 pass here
npx vitest run tests/fleetEarnings.test.tsx tests/insights.test.tsx tests/modelsAutopilot.test.tsx tests/modelsRanking.test.tsx tests/app.test.tsx tests/earningsSignedOut.test.tsx   # 38 passed
npx tsc --noEmit
npx prettier --check src tests
make docs-impact-check BASE=origin/codex/desktop-mac-preview-20261012

Limitations

  • The prompt points to the sidebar account control rather than opening the sign-in dialog inline.
  • Not exercised against a real signed-out session. The state combination comes from DesktopAccountActions.swift and DesktopSnapshot.swift.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

useInsights reads earnings only while the account is signed in or has
legacy data, but Earnings, Home's fleet chart and the Models earnings
order chose their message from `linked`. Signing out, or the dashboard
session expiring after 30 days, clears the session without clearing
the provider link, so those views showed "Loading…" forever with no
retry.

Expose whether insights can load from the hook and show a sign-in
prompt when a linked Mac cannot read them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Oct 13, 2026 10:48pm UTC
d-inference-console-ui-dev Ready Ready Preview Oct 13, 2026 10:48pm UTC
d-inference-landing Ready Ready Preview Oct 13, 2026 10:48pm UTC
darkbloom-status Ready Ready Preview Oct 13, 2026 10:48pm UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 13, 2026 10:48pm UTC

Request Review

This branch was successfully deployed

5 active deployments
Preview – d-inference — 4eecf319 Deployed Oct 13, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 4eecf319 Deployed Oct 13, 2026 by vercel[bot]
Preview – d-inference-landing — 4eecf319 Deployed Oct 13, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 4eecf319 Deployed Oct 13, 2026 by vercel[bot]
Preview – darkbloom-status — 4eecf319 Deployed Oct 13, 2026 by vercel[bot]
benchmarks — 4eecf319 Deployed Oct 13, 2026 by jonathan308 via E2E Benchmarks #2613
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