Skip to content

fix(workspaces): drop unusable serverside redirect after scheduling deletion - #941

Merged
realcodesiman merged 1 commit into
mainfrom
fix/workspace-deletion-drop-serverside-redirect
Aug 11, 2026
Merged

fix(workspaces): drop unusable serverside redirect after scheduling deletion#941
realcodesiman merged 1 commit into
mainfrom
fix/workspace-deletion-drop-serverside-redirect

Conversation

@realcodesiman

@realcodesiman realcodesiman commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removed the server-side redirect() in scheduleWorkspaceDeletionAction — it targeted the same settings page the client already reloads via onSuccess, so it was dead code (the client's window.location.reload() takes over before the redirect could matter).
  • Kept the client-side window.location.reload() in workspace-deletion-card.tsx as the single source of truth for refreshing the page after scheduling deletion.
  • Updated the action's test to match the new contract (resolves normally instead of throwing NEXT_REDIRECT).

Changes

  • apps/builder/src/features/workspaces/actions/schedule-workspace-deletion-action.ts
  • apps/builder/__tests__/schedule-workspace-deletion-action.test.ts

Test plan

  • pnpm vitest run __tests__/schedule-workspace-deletion-action.test.ts passes
  • pnpm --filter builder check-types
  • pnpm lint (touched files clean; pre-existing unrelated lint findings elsewhere untouched)
  • Manual verification: schedule and cancel workspace deletion in the UI, confirm the card refreshes correctly

…eletion

The schedule-deletion action redirected server-side to the same
settings page the client already reloads via onSuccess, so the
redirect never had a chance to run before the client's
window.location.reload() took over. Remove the dead redirect and
keep the client-side reload as the single source of truth for the
post-action refresh.

Update the action's test to match: it now resolves normally instead
of throwing NEXT_REDIRECT, so drop the next/navigation mock and
redirect assertion.
@github-actions github-actions Bot added the bug Something isn't working as expected label Aug 11, 2026
@realcodesiman
realcodesiman merged commit 932eae5 into main Aug 11, 2026
8 checks passed
@realcodesiman
realcodesiman deleted the fix/workspace-deletion-drop-serverside-redirect branch August 11, 2026 14:53
viethung0o0 pushed a commit that referenced this pull request Sep 7, 2026
…eletion (#941)

The schedule-deletion action redirected server-side to the same
settings page the client already reloads via onSuccess, so the
redirect never had a chance to run before the client's
window.location.reload() took over. Remove the dead redirect and
keep the client-side reload as the single source of truth for the
post-action refresh.

Update the action's test to match: it now resolves normally instead
of throwing NEXT_REDIRECT, so drop the next/navigation mock and
redirect assertion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant