account: include pending-deletion workspaces in getPendingWorkspace 'all' operation - #11004
Open
IamCoder18 wants to merge 1 commit into
Open
Conversation
…all' operation
The default workspace-pod operation mode is 'all', which previously
matched only pending-creation / creating and pending-upgrade workspaces.
Soft-deleted workspaces (mode='pending-deletion') never matched, so they
were never picked up by the worker and never reaped. Selfhosts that do
not set WS_OPERATION=all+backup (the recommended mode that does include
deletion) silently accumulate orphan rows.
Extend the 'all' branch to also match pending-deletion / deleting in
both PostgresAccountDB and MongoAccountDB so the operation name does
what it says. The 'all+backup' branch is unchanged (already correct).
Drop the stale TODO that called out this gap.
Tests assert the pending-deletion clause is present in both backends.
Signed-off-by: Aarav Sharma <iamcoder18@gmail.com>
IamCoder18
force-pushed
the
fix/account-get-pending-workspace-all-deletion
branch
from
August 5, 2026 02:00
0ce95e7 to
1be40db
Compare
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.
Context
The
getPendingWorkspacequery supports an'all'operation that selects workspaces pending any worker action. It only matched workspaces pending creation or upgrade, so workspaces waiting on deletion were never picked up by the worker and just sat there. The'all+backup'branch already includes the deletion clause, so this is a missing entry rather than a new behavior.Implementation
In
server/account/src/collections/mongo.ts, the'all'case now spreadsdeletingQueryinto the existing or-clauses. Inserver/account/src/collections/postgres/postgres.ts, the'all'SQL now ORs in the existingdeletingSql, matching the pattern used for pending creation and upgrade. The stale TODO comment about returning pending deletion workspaces was removed.Tests
Updated the
'all'SQL snapshot inpostgres.test.tsto include the new clause and added a focused test inmongo.test.tsthat asserts the'all'operation's or-array contains astatus.mode $in ['pending-deletion', 'deleting']clause.