Skip to content

feat: Support logical deletion within APIs#24

Merged
Vasilijez merged 6 commits into
developfrom
feature-delete-user-complete
Oct 29, 2025
Merged

feat: Support logical deletion within APIs#24
Vasilijez merged 6 commits into
developfrom
feature-delete-user-complete

Conversation

@Vasilijez

@Vasilijez Vasilijez commented Oct 28, 2025

Copy link
Copy Markdown
Member

@magley magley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Scenario:

  • Guest G creates a reservation request
  • Host H opens the reservation requests page
  • G deletes his account
  • H clicks on the "approve" request
  • A reservation is made even though the user deleted his account

From what I can tell, this is a more subtle bug, because normally when you fetch reservation requests, you exclude ones from deleted users. But this is a sort-of concurrent edge case, because the host fetches requests BEFORE the user deletes his account, and accepts the request AFTER the user deletes his account.

I've left this review as a [Comment] instead of [Request changes] because while I believe this should be addressed, it's up to you whether you should actually do it. It's not much work, though, just fetch the user and check the Deleted field.

This got me thinking: how did this happen? The fault in the code is that we don't fetch the user before approving the request, and this is present elsewhere in the architecture. If this were a monolith, the database would "catch" the issue because of foreign keys (assuming we'd do physical deletes).

@Vasilijez

Copy link
Copy Markdown
Member Author

Scenario:

  • Guest G creates a reservation request
  • Host H opens the reservation requests page
  • G deletes his account
  • H clicks on the "approve" request
  • A reservation is made even though the user deleted his account

From what I can tell, this is a more subtle bug, because normally when you fetch reservation requests, you exclude ones from deleted users. But this is a sort-of concurrent edge case, because the host fetches requests BEFORE the user deletes his account, and accepts the request AFTER the user deletes his account.

I've left this review as a [Comment] instead of [Request changes] because while I believe this should be addressed, it's up to you whether you should actually do it. It's not much work, though, just fetch the user and check the Deleted field.

This got me thinking: how did this happen? The fault in the code is that we don't fetch the user before approving the request, and this is present elsewhere in the architecture. If this were a monolith, the database would "catch" the issue because of foreign keys (assuming we'd do physical deletes).

Thanks, I appreciate it. Really nice catch, I solved it. 33e7aac

@Vasilijez Vasilijez requested a review from magley October 29, 2025 09:51

@magley magley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems OK now.

@Vasilijez Vasilijez force-pushed the feature-delete-user-complete branch from 33e7aac to cc064a8 Compare October 29, 2025 10:06
@Vasilijez Vasilijez merged commit 393fe11 into develop Oct 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User account deletion

2 participants