fix(workspaces): make delete/rename dialogs recoverable and batch kernel deletes#622
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(workspaces): make delete/rename dialogs recoverable and batch kernel deletes#622posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
…nel deletes The bulk-delete alert only closed inside the mutation's onSuccess and had no error surface, and the rename dialog fired mutate() then closed unconditionally on the next line. When the workspace kernel was slow or errored, users were left with a frozen/disabled dialog or a silently dismissed rename that lost their input. - Delete alert: surface the failure inline, keep the modal open, and relabel the action to "Retry delete" so the user can retry instead of being wedged. Reset the mutation on close so a reopen starts clean. - Rename dialog: await the mutation, close only on success, and keep the dialog open with an inline error and the user's typed value preserved (controlled input) so they can correct and retry in place. - Kernel deleteItems: stream file removals in bounded batches instead of firing every workspace.rm at once, so a multi-item delete doesn't blow the Durable Object memory/storage budget. Generated-By: PostHog Code Task-Id: d66ba4e3-c24d-4160-80d0-8d3b1ff22e2b
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Users got stuck on a frozen delete/rename dialog whenever the workspace kernel was slow or errored, forcing them to cancel and retry. Both signals trace to
WorkspaceItemActionDialogs.tsx: the bulk-delete alert only closed inside the mutation'sonSuccessand surfaced no error on failure, while the rename dialog firedmutate()and closed unconditionally on the next line — silently dropping the user's input on a failed rename. Underneath, a multi-item delete fired everyworkspace.rmat once, which overran the Durable Object memory/storage budget and tripped memory-limit / storage-timeout resets on the server.What changed
deleteItems— stream file removals in bounded batches instead of one bigPromise.all, so a multi-item delete doesn't load every removal at once and blow the Durable Object budget.This mirrors the recoverable pattern the Move dialog already uses.
Testing
deleteItemsstreams removals with bounded concurrency (≤4 in flight) rather than all at once.pnpm check(format + lint + types) and the full test suite pass.Note: the dialog behavior is a client-side UX change; I verified it via code review and the mutation-state logic, but could not spin up the full Cloudflare app in this environment to record the flow.
Created with PostHog Code from an inbox report.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.