Skip to content

fix: prompt unexpectedly signed-out Cloud users once per version - #19966

Merged
Jinwoo-H merged 6 commits into
mainfrom
sign-in-dialogue
Sep 11, 2026
Merged

Jinwoo-H merged 6 commits into
mainfrom
sign-in-dialogue

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​494 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​493
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​372 $\color{#cf222e}{\Huge{\mathbf{−}}}$​27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​345

ELI5

Users whose linked Orca Cloud session disappeared get a bottom-right card to sign in again. Explicitly signed-out and unconfigured users never qualify. Dismissing the card or successfully reconnecting keeps it hidden for the running app version.

What Changed

  • Add the card with a sign-in action and expandable descriptions of restored cloud features.
  • Require hydrated UI state, a known app version, configured auth, reconnect-required, and a retained cloud link.
  • Persist dismissedUnexpectedSignoutVersion through ui:set, including defaults, hydration, RPC schema, and parity coverage. Retain observed dismissals in session state so stale UI sync cannot re-arm the card.
  • Observe recovery independently of visibility; a cached connected status does not count as a successful re-sign-in. Repeated effects do not repeat dismissal writes.
  • Restrict query/localStorage preview flags to development; preview dismissal does not mutate real dismissal state.

Why

The recent unexpected sign-out incident left previously signed-in users without a clear path back to Cloud features. Adversarial regression tests exposed the unreachable sign-in dismissal effect, production preview bypass, ineffective preview dismissal, stale hydration re-arming, repeated writes, and inconsistent unconfigured auth acceptance. Each fix was verified after reproducing the failure.

Linked Issue

User-requested follow-up to the recent Cloud sign-out incident; no issue supplied.

Visual Proof

Optional Electron visual check was not run. Component behavior is covered by rendered happy-dom tests; no screenshot attached.

Testing

  • ORCA_BACKGROUND_LAUNCH=1 pnpm run typecheck
  • ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts unexpected-signout UpdateCard ui-notice-dismissals client-ui profile-cloud-auth-status profile-cloud-service profile-cloud-session-store — 230 tests across 13 suites.
  • ORCA_BACKGROUND_LAUNCH=1 node config/scripts/check-changed-code-quality.mjs
  • Commit-hook lint and formatting.

Automated validation ran on macOS. Auth coverage includes explicit sign-out/link removal, unconfigured profiles, memory-only sessions, missing credentials, decrypt failures, and unreadable credentials. This uses profile/UI state independently of git or folder workspaces; no execution-host or git-provider behavior changes. Windows/Linux/SSH manual checks and a full build were not run.

Agent skill upstream boundary

  • Not applicable; no agent skill changes.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: d0c12951-a405-4711-96e1-7605768c661a

📥 Commits

Reviewing files that changed from the base of the PR and between 5939bc7 and 6369427.

📒 Files selected for processing (2)
  • src/renderer/src/components/UnexpectedSignoutCard.tsx
  • src/renderer/src/components/unexpected-signout/unexpected-signout-card.test.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/components/unexpected-signout/unexpected-signout-card.test.tsx
  • src/renderer/src/components/UnexpectedSignoutCard.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

Adds unexpected sign-out detection for cloud-linked profiles. Adds version-aware dismissal state with RPC validation, hydration, persistence, and synchronization. Adds a lazy-loaded recovery card with sign-in, dismissal, feature details, and development preview support. Adds notification stacking, localization, and tests for authentication, visibility, recovery, persistence, and remount behavior.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 63694

During background update checks, the recovery card can be displaced even though no update card is visible. This is a bounded presentation issue and should be addressed before release if the notification layout is user-facing.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, rationale, implementation, and automated testing. However, it does not provide the required linked issue, and the required visual proof is incomplete for this UI c… Add the issue reference after “Fixes #”. Provide before-and-after screenshots or videos, or write exactly “N/A” with a brief reason if visual proof is not applicable. Complete the remaining required checklist sections as applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 19 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: prompting linked Cloud users after an unexpected sign-out once per app version.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the change, rationale, implementation, and automated testing. However, it does not provide the required linked issue, and the required visual proof is incomplete for this UI change.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/renderer/src/components/UnexpectedSignoutCard.tsx (1)

150-150: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use intent-named localization IDs and named interpolation.

These new strings use hash-based auto.components... IDs. The email interpolation also uses value0. Replace the new card IDs with intent-named IDs, use an email placeholder, and update the corresponding locale entries.

Based on learnings: “For newly added user-facing strings in stablyai/orca TypeScript and TSX files, follow config/i18n-translation-source.md: use intent-named localization IDs with named interpolation placeholders. Treat existing hash-based IDs as grandfathered.”

Also applies to: 169-171

Source: Learnings


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: f4d0afec-f92b-4b00-ba21-3fa2b579d56e

📥 Commits

Reviewing files that changed from the base of the PR and between fb9ba4b and 4a1ca62.

📒 Files selected for processing (16)
  • src/main/orca-profiles/profile-cloud-auth-status.test.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/runtime/rpc/methods/client-ui.test.ts
  • src/renderer/src/app-shell/AppRootSurfaces.tsx
  • src/renderer/src/components/UnexpectedSignoutCard.tsx
  • src/renderer/src/components/unexpected-signout/unexpected-signout-card.test.tsx
  • src/renderer/src/components/unexpected-signout/unexpected-signout-visibility.test.ts
  • src/renderer/src/components/unexpected-signout/unexpected-signout-visibility.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/ui-notice-dismissals.test.ts
  • src/renderer/src/store/slices/ui/ui-slice-contract-preferences.ts
  • src/renderer/src/store/slices/ui/ui-slice-hydration-actions.ts
  • src/renderer/src/store/slices/ui/ui-slice-hydration-sanitizers.ts
  • src/renderer/src/store/slices/ui/ui-slice-update-actions.ts
  • src/shared/constants.ts
  • src/shared/persisted-ui-state-types.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


const email = authStatus?.cloud?.email?.trim() || null
const canConnect = authStatus?.configured === true
const updateCardVisible = updateStatus.state !== 'idle' && updateStatus.state !== 'not-available'

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the card position with the update-card mount rule.

When updateStatus.state is checking and userInitiated is false, src/renderer/src/app-shell/AppRootSurfaces.tsx lines 113-120 do not mount UpdateCard. Line 122 still moves this card to bottom-[220px]. This leaves an empty gap above the bottom edge. Use the same checking and userInitiated condition here.

@pullfrog pullfrog Bot 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.

ℹ️ Minor suggestions only — one copy divergence and one positioning nit inline.

Reviewed changes

  • UnexpectedSignoutCard component — a bottom-right card that prompts users in reconnect-required state to sign back in, with a collapsible feature list, a dev-only preview flag, and sign-in/dismiss actions.
  • Visibility gate (shouldShowUnexpectedSignoutCard) — requires hydrated UI state, a resolved app version, configured auth, reconnect-required, and a retained cloud link, correctly excluding explicit sign-out, unconfigured, and connected profiles.
  • Dismissal persistence — a new dismissedUnexpectedSignoutVersion field wired through the RPC schema, getDefaultUIState, hydration sanitizers, and update actions; a session-level unexpectedSignoutDismissedVersions history prevents stale UI sync from re-arming the card.
  • Recovery observation — an effect stamps dismissal on a genuine reconnect independently of visibility and without repeated writes.
  • Tests — adversarial coverage of auth-status derivation, visibility gating, dismissal persistence, and component lifecycle across 13 suites.

The auth/recovery/dismissal logic is correct and the gating is tight; the "once per version" semantics, stale-hydration protection, and preview isolation are all sound.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot 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.

✅ No new issues found in this delta — the catalog alignment is correct and resolves the prior copy-divergence nit.

Reviewed changes

  • en.json copy alignment — 7b4d9e1f2a and 5a1c8d3e6f now match the component's fallback strings verbatim, so English and untranslated-locale users see identical sign-in copy.

The remaining positioning nit (bottom-[220px] vs the dynamic UpdateCard height) from the prior review is unchanged and still optional.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot 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.

✅ No new issues found in this delta — the fixed-offset overlap heuristic is replaced with real flex stacking, resolving the prior positioning nit.

Reviewed changes

  • NotificationCardStack — a new fixed bottom-right container (flex-col-reverse, overflow-y-auto, pointer-events-none with per-child pointer-events-auto) that stacks notification cards by their rendered height.
  • Per-card positioning removed — UpdateCard, StarNagCard, and UnexpectedSignoutCard now render as plain flex children, dropping the bottom-[220px]/updateCardVisible heuristic and their fixed/z-40 wrappers.
  • Test harness updated — UpdateCard.error-card.test.tsx wraps its render in NotificationCardStack.

The OverlayBoundary/RecoverableRenderErrorBoundary wrappers render children without a DOM node, so the stack's [&>*] selectors land on the card roots as intended, and cardRootRef in UpdateCard only clears animation timers, so losing the fixed wrapper is safe.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot 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.

ℹ️ No critical issues — one minor test-coverage suggestion below.

Reviewed changes

  • Gated the signout card on a fresh auth read — UnexpectedSignoutCard now calls fetchOrcaProfileAuthStatus() itself on mount and only renders once it settles (authRefreshReady), replacing the useOrcaProfileAuthStatusRefresh fire-and-forget hook whose first render could race a stale cached status. The recovery-observation effect and the dev preview path are untouched.

ℹ️ Nitpicks

  • The authRefreshReady timing gate has no failing-first coverage. Every unexpected-signout-card test seeds orcaProfileAuthStatus as reconnect-required and mocks the fetch to resolve immediately, so removing the gate would not fail any test. Holding the fetch promise open, asserting the card stays hidden, then resolving and asserting it appears would lock the fix in — consistent with the PR's reproduce-first testing note.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 9d2d0ecc-d85c-40db-93d7-5d6c3a55db7d

📥 Commits

Reviewing files that changed from the base of the PR and between a5450cf and 5939bc7.

📒 Files selected for processing (1)
  • src/renderer/src/components/UnexpectedSignoutCard.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@pullfrog pullfrog Bot 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.

ℹ️ No critical issues — the verified-auth gate is correct; one test-coverage suggestion inline.

Reviewed changes

  • Required verified auth before signout recovery — the mount-time fetchOrcaProfileAuthStatus() now sets authRefreshReady only when it resolves a non-null status (replacing the .finally that also fired on failure), and the recovery-observation effect is additionally gated on authRefreshReady.
  • Test harness updated — the card test mock now resolves the seeded status object instead of undefined, matching the new non-null gate.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes

  • Retried transient auth-readiness failures — the mount-time fetchOrcaProfileAuthStatus() now retries up to three times (500ms apart) before giving up, so a transient null/failed authStatus() read no longer permanently suppresses the card and recovery observation for the session.

The retry is bounded, cancellation-safe, and directly resolves the transient-failure concern from the prior round.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 47b6c75 into main Sep 11, 2026
27 checks passed
Jinwoo-H added a commit that referenced this pull request Sep 11, 2026
Conflict in client-ui-schemas.ts: main (#19966) added
dismissedUnexpectedSignoutVersion to UiUpdateFields while this branch moved
UiUpdateFields to src/shared/rpc-contract/client-ui-params.ts. Kept the
re-export and re-applied main's field at the schema's new home, so the
signed-out-user prompt keeps its persisted dismissal field.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
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