fix(Segments): delete_segment task crashes when segment already deleted - #8136
fix(Segments): delete_segment task crashes when segment already deleted#8136bardock-2393 wants to merge 1 commit into
Conversation
The async delete_segment task fetches the segment by id before deleting it, but concurrent execution (e.g. a cascading feature or project delete racing with a prior run of the same task) can remove the row first, causing Segment.DoesNotExist to crash the task.
|
@bardock-2393 is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe segment deletion task now catches Estimated code review effort: 1 (Trivial) | ~5 minutes Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The async delete_segment task fetches a segment by id and deletes it, but a concurrent delete of the same segment (e.g. a cascading project or feature delete racing with another delete of the same segment) can remove it first. The task then crashes with Segment.DoesNotExist instead of treating the segment as already gone.
Changes
Closes #7354
Review effort: 1/5