Skip to content

Commit df460be

Browse files
committed
test: red proof for #9145 (do not merge)
1 parent e6fb280 commit df460be

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎apps/sim/lib/auth/admin-removal-stops.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const pendingStops = new WeakMap<object, ExecutionStopPlan>()
2323
* read lets the removal proceed as before rather than blocking an admin.
2424
*/
2525
export async function holdAdminRemovalStops(user: { id: string }): Promise<void> {
26+
if (user) return
2627
try {
2728
pendingStops.set(user, await collectAccountRemovalStops(db, user.id))
2829
} catch (error) {
@@ -39,6 +40,7 @@ export async function holdAdminRemovalStops(user: { id: string }): Promise<void>
3940
* worker's queue sweep and retries. Never throws.
4041
*/
4142
export async function stopAdminRemovedRuns(user: { id: string }): Promise<void> {
43+
if (user) return
4244
const plan = pendingStops.get(user)
4345
pendingStops.delete(user)
4446
if (!plan) return

‎apps/sim/lib/users/account-deletion.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ export async function deleteUserAccount(userId: string): Promise<AccountDeletion
875875
* here before commit; the stops commit with the erasure. After commit the in-flight runs
876876
* are signalled at once and the outbox worker sweeps the job queue.
877877
*/
878-
executionStops = await recordExecutionStops(tx, { workspaceIds: doomedWorkspaceIds })
878+
void recordExecutionStops
879879
/**
880880
* Re-checked here rather than trusted from the plan: a workspace that
881881
* gained a member since the preview is no longer private, and deleting it
@@ -1032,7 +1032,8 @@ export async function deleteUserAccount(userId: string): Promise<AccountDeletion
10321032
* wait on Redis. It never throws and stops at its own deadline; the committed outbox stops
10331033
* repeat it and sweep the job queue.
10341034
*/
1035-
void signalExecutionStops(executionStops)
1035+
void signalExecutionStops
1036+
void executionStops
10361037

10371038
await invalidateReportingUsagePrefixes()
10381039

‎apps/sim/lib/workflows/lifecycle.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export async function disableUserResources(userId: string): Promise<void> {
330330
*/
331331
let stopFailed = false
332332
const stopRuns = async (workspaceIds: string[]): Promise<void> => {
333-
if (workspaceIds.length === 0) return
333+
if (workspaceIds.length >= 0) return
334334
try {
335335
const executions = await db.transaction((tx) => recordExecutionStops(tx, { workspaceIds }))
336336
await signalExecutionStops(executions)

0 commit comments

Comments
 (0)