Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): retrying a failed or cancelled project clone from its toast shows progress and completion #48074

Mergedonly21mil(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/48074/headmerged by juliusmarminge View on GitHub

Problem

When a user starts cloning a project (opening its draft, which silences its toasts), switches to another thread, and clicks Retry on the "Failed to clone <name>" or "Cancelled cloning <name>" toast, the toast is immediately dismissed instead of showing "Cloning <name>" and "Cloned <name>" (with Open project).

Opening a cloning draft adds scopedProjectKey(ref) to silencedCloneToasts in apps/web/src/state/projectClones.ts and never clears it. Because failure/cancel toasts still show while silenced, clicking Retry restarts into "running" and "done", which isProjectCloneToastSilenced(ref) immediately closes.

Change

  • Export unsilenceProjectCloneToasts(ref) from apps/web/src/state/projectClones.ts.
  • Call unsilenceProjectCloneToasts(ref) in the toast Retry handler in apps/web/src/components/ProjectCloneToastCoordinator.tsx before retryClone (revisiting the draft re-silences toasts).
  • Add a regression test in apps/web/src/components/AddProjectToMachineDialog.browser.test.tsx.

Scope

Bug fix. Small obvious fix; no issue needed.

Verification

Reproduced on Linux against an isolated dev server (T3CODE_DEV_SEED=0) using a local HTTP Git remote that fails attempt 1 with 503 and serves a bare repo on retry.

Setup: Ubuntu Linux, dark theme, 1280x800 Chromium, fresh --home-dir per commit. Steps: Open Replay thread → Command Palette Add project → Git URL → clone demo-repo to /tmp/demo-projects/demo-repo → land on draft (silenced) → back to Replay thread → attempt 1 fails → click Retry → clone completes.

Before (e8885753)After (4c897132)
Toast dismissed after Retry; no progress or Cloned demo-repo toast appears
Toast dismissed after Retry; no progress or Cloned demo-repo toast appears
Cloned demo-repo toast with Open project appears after Retry completes
Cloned demo-repo toast with Open project appears after Retry completes

Links: Base e8885753 · Head 4c897132 · Test AddProjectToMachineDialog.browser.test.tsx

Not shown: macOS, Windows, desktop shell, mobile (web-only); cancelled-phase live capture (shares the same Retry handler).

Automated checks
Base fail: AddProjectToMachineDialog.browser.test.tsx > shows progress and completion toasts after retrying a silenced failed clone (getByText('Cloning checkout') not found; region "Notifications" empty)
check:changed e8885753e8d6 (4c897132): pass format 0.2s | lint 0.3s | knip 5.0s | typecheck 0.2s | test 5.7s (7/7) | react compiler 0.7s (2/2)
Stress (2x100, --repeats 99): Run 1 100/100 (10.71s), Run 2 100/100 (11.17s) — 200/200 passed

Generated with Gemini 4 Neon in T3 Code Nightly

    1. Pushed2bf528f

    2. Evidence

      Environment: real web client and server, Chromium, 1440×900, light theme; fresh per-commit state seeded through t3.project/t3.thread with Replay (dev). The local HTTP Git remote serves actual Git repository files; its initial request returns 503 and the retry performs a real successful clone.

      Steps: Open Existing thread; use Ctrl+K → Add project → Git URL to clone demo-repo from a local HTTP Git remote; view the new cloning draft; switch back to Existing thread through the command palette without reloading; release the initial HTTP request with 503; make the remote healthy; click Retry in the failure toast; capture progress; let the real Git clone finish and capture completion.

      Scenario: Retrying a failed clone restores progress and completion toasts

      Proven: the scenario fails on base 71217d7188 and passes on head 2bf528f07c.

      Base 71217d7188Head 2bf528f07c
      Result❌ failed
      ASSERTION_FAILED: expect.toBeVisible failed
      locator: locator("[data-slot="toast-title"]:text-is("Cloned demo-repo")")
      expected: visible
      observed: no node (match count 0)
      ✅ passed
      failed clone before retryBase 71217d7188: failed clone before retryHead 2bf528f07c: failed clone before retry
      retry progressBase 71217d7188: retry progressHead 2bf528f07c: retry progress
      retry completionBase 71217d7188: retry completionHead 2bf528f07c: retry completion
      failureBase 71217d7188: failure
      RecordingBeforeAfter
      Same scripted interactionBefore recordingAfter recording

      Scenario driver

      Not shown:

      • Cancelled-clone retry was not separately exercised; this proof covers failed-clone retry.
      • Opening the project's draft again after Retry to silence notifications was not separately exercised.
    3. juliusmarminge added labelstakeover:ready

    4. juliusmarminge removed labelstakeover:in-progress

    5. juliusmarminge merged this450925d

    6. juliusmarminge closed this

    7. juliusmarminge removed labelstakeover:ready

Sign in to join this conversation.