Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleaning workspace job - fix on soft delete condition #10380

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

etiennejouan
Copy link
Contributor

@etiennejouan etiennejouan commented Feb 21, 2025

Context
If the command runs multiple times, soft deleted workspaces are soft deleted again (+ email spamming)

Solution
Check for soft deletion before entering soft delete condition

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds a condition to prevent re-processing of soft-deleted workspaces in the workspace cleaning service, preventing duplicate deletion emails from being sent to workspace members.

  • Added !isDefined(workspace.deletedAt) check in /packages/twenty-server/src/engine/workspace-manager/workspace-cleaner/services/cleaner.workspace-service.ts to prevent re-processing soft-deleted workspaces
  • Ensures workspace members only receive deletion notification emails once when their workspace is initially soft-deleted

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@etiennejouan etiennejouan changed the title fix on soft delete condition cleaning workspace job - fix on soft delete condition Feb 21, 2025
@charlesBochet charlesBochet merged commit 5863c45 into main Feb 21, 2025
30 checks passed
@charlesBochet charlesBochet deleted the ej/cleaning-command-update branch February 21, 2025 11:12
Copy link
Contributor

Thanks @etiennejouan for your contribution!
This marks your 29th PR on the repo. You're top 2% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

charlesBochet pushed a commit that referenced this pull request Feb 21, 2025
Context
If the command runs multiple times, soft deleted workspaces are soft
deleted again (+ email spamming)

Solution
Check for soft deletion before entering soft delete condition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants