Fix more deletion bugs with review request drafts.
Review Request #13863 — Created May 16, 2024 and submitted
We had two additional deletion bugs lurking with review request drafts.
Deleting ("discarding") the draft was failing to delete the associated
ChangeDescription and DiffSet objects, causing these to be left
orphaned. This was once again exposing the API bug where attempting to
serialize a link to an orphaned object was crashing when it tried to get
the parent object (in this case the draft that was the parent of a
DiffSet that had no associated history object).Bullet-proofing the API serialization will happen separately in a later
version, since that's likely to be invasive and risky, and we're close
to release for RB7. This change handles the deletion issues.The one thing which is potentially still undeleted is the screenshots
relation, but we no longer provide any way for users to create
Screenshot objects, so that should be virtually impossible to hit.
- Ran unit tests.
- Created drafts with various types of data attached and verified that
after I discarded those drafts, all related data was properly deleted.
Summary | ID |
---|---|
905be5f9139b985726871c9f5664bedea4959c7d |