Skip to content

Commit

Permalink
fix: add yet another explicit delete
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi committed Dec 10, 2024
1 parent 7847675 commit d7bc79a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions front/poke/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
AgentUserRelation,
GlobalAgentSettings,
} from "@app/lib/models/assistant/agent";
import { AgentMessageContent } from "@app/lib/models/assistant/agent_message_content";
import {
AgentMessage,
AgentMessageFeedback,
Expand All @@ -43,7 +44,11 @@ import {
UserMessage,
} from "@app/lib/models/assistant/conversation";
import { Subscription } from "@app/lib/models/plan";
import { MembershipInvitation, Workspace } from "@app/lib/models/workspace";
import {
MembershipInvitation,
Workspace,
WorkspaceHasDomain,
} from "@app/lib/models/workspace";
import { AppResource } from "@app/lib/resources/app_resource";
import { ContentFragmentResource } from "@app/lib/resources/content_fragment_resource";
import { DataSourceResource } from "@app/lib/resources/data_source_resource";
Expand All @@ -63,7 +68,6 @@ import { UserMetadataModel } from "@app/lib/resources/storage/models/user";
import { UserResource } from "@app/lib/resources/user_resource";
import { renderLightWorkspaceType } from "@app/lib/workspace";
import logger from "@app/logger/logger";
import { AgentMessageContent } from "@app/lib/models/assistant/agent_message_content";

const hardDeleteLogger = logger.child({ activity: "hard-delete" });

Expand Down Expand Up @@ -606,6 +610,10 @@ export async function deleteWorkspaceActivity({
await FileResource.deleteAllForWorkspace(workspace, t);
await RunResource.deleteAllForWorkspace(workspace, t);
await MembershipResource.deleteAllForWorkspace(workspace, t);
await WorkspaceHasDomain.destroy({
where: { workspaceId: workspace.id },
transaction: t,
});
await AgentUserRelation.destroy({
where: { workspaceId: workspace.id },
transaction: t,
Expand Down

0 comments on commit d7bc79a

Please sign in to comment.