Skip to content

fix(web,api): storage settings post-save cleanup + activation reliability (#788) - #790

Merged
Zach Dunn (zachdunn) merged 4 commits into
mainfrom
claude/storage-settings-788
Aug 23, 2026
Merged

fix(web,api): storage settings post-save cleanup + activation reliability (#788)#790
Zach Dunn (zachdunn) merged 4 commits into
mainfrom
claude/storage-settings-788

Conversation

@zachdunn

Copy link
Copy Markdown
Member

Closes #788.

Two-state storage page

The post-save screen stacked the connect pitch, the 3-step walkthrough, the CTA, and three separate status strings on top of the saved-bucket card. Now the page renders one state at a time:

  • No saved lane — intro, "Connect your own bucket", and the walkthrough, as before.
  • Saved lane — the lane card is the page: a "Not in use yet" badge, a context line saying uploads currently go to shared storage, details, and "Use this bucket" as the primary action ("Rotate credentials" / "Replace bucket" secondary). The intro/walkthrough/CTA are hidden; the lingering "Saved." status line is gone (the card appearing is the confirmation).
  • Active BYO — the existing view gains a "Your bucket · Active" heading and a "New uploads go to this bucket" line.

In-page switch confirmation

window.confirm (a native "uploads.sh says…" browser alert) replaced with an in-page confirm box in both views, covering all three confirmation sites (use bucket, switch back, forced switch back).

"Couldn't switch. Try again." for a switch that succeeded

A lane activated >10 min after verification triggers a server-side re-verify (which legitimately includes a 5s public-URL probe and jurisdiction probing) plus an awaited usage reconcile — together they could outlive the browser's default 8s request timeout. The worker kept going and committed the switch; the client reported failure. Fixed three ways:

  1. Storage verify/save/buckets/activate/detach client calls get a 30s timeout.
  2. The activate/detach usage reconcile moves off the response path via waitUntil (unit-test runtimes without an execution context fall back to awaiting).
  3. On a failed-looking activation the client re-checks status before reporting failure — if the target lane is no longer listed among non-active lanes it was promoted, so the UI shows the switch instead of a false error.

Drive-by fix

#785's dev-only /dev/ui-kit page reads env.ENVIRONMENT, but apps/web never declared the var — pnpm typecheck failed on main, and the production 404 gate never tripped (undefined ≠ "production"), leaving the dev page live on prod. Declared ENVIRONMENT: "production" in apps/web's wrangler vars, matching the apps/api / apps/auth convention.

Testing

  • pnpm test (4907 tests) green; pnpm typecheck (Node 24) clean including the previously-failing apps/web; lint + format clean.
  • Every requireElement selector cross-checked against the markup (1:1); no native confirm( remains.

#785 shipped the dev-only UI kit page reading env.ENVIRONMENT, but apps/web
never declared the var — typecheck failed and the production 404 gate never
tripped (undefined !== "production"), leaving the page live on prod.
…, no more ghost switch failures (#788)

- Lane card is the page once a bucket is saved: connect pitch + walkthrough
  hidden, state badge (Active / Not in use yet), context line for where
  uploads currently go, Replace bucket reopens the wizard, and the stray
  'Saved.' status line is gone.
- window.confirm replaced with an in-page confirm box in both views.
- 'Couldn't switch' ghost fixed three ways: storage verify/save/activate/
  detach client calls get a 30s timeout (the pipeline legitimately includes
  a 5s public-URL probe and jurisdiction probing), the activate/detach usage
  reconcile moves off the response path via waitUntil, and on a failed-
  looking activation the client re-checks status before reporting failure —
  a promoted lane means the switch actually landed.
@changeset-bot

changeset-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1a201b1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 23, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
uploads-web 1a201b1 Commit Preview URL

Branch Preview URL
Aug 23 2026, 01:05 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 23, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
uploads-api e9d1f3f Commit Preview URL

Branch Preview URL
Aug 23 2026, 12:56 AM

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (2)
  • coderabbit:review
  • review
🚫 Excluded labels (none allowed) (1)
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b4f6c60-cad4-4a49-a669-613fd7424707

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

…LaneId

Review findings on the first cut: openWizard left the lane card (and its
live Use-this-bucket/Switch-back buttons) stacked above the wizard, and the
activation self-heal inferred success from the lane's absence in `lanes` —
a stale-id 404 would also read as absent. The wizard now owns the page
while open (closeWizard restores from the last-loaded status), and the
self-heal requires `activeLaneId === laneId`.
@zachdunn
Zach Dunn (zachdunn) merged commit 8b6453a into main Aug 23, 2026
4 checks passed
@zachdunn
Zach Dunn (zachdunn) deleted the claude/storage-settings-788 branch August 23, 2026 01:07
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.

Storage settings: post-save state is cluttered — collapse the wizard and make lane state the page

1 participant