Implement multiple-object coalescing for review replies.

Review Request #12200 — Created March 22, 2022 and submitted

Information

Review Board
release-3.0.x
16f4f45...

Reviewers

In Review Board, a pending review object or pending reply object is
intended to be unique to each user (that is, a user may only have one
pending reply to a given review at a time). Unfortunately, we do hit
cases where network lag, overloaded webservers, or slow databases can
create situations where multiple API requests come in and end up
creating multiple objects. This then results in errors about
MultipleObjectsReturned when attempting to fetch later.

We already have logic for reviews to detect this situation and coalesce
duplicates into a single review. This change implements something very
similar for pending review replies, leveraging the same coalescing
logic.

Ran unit tests. Before the fix, this would hit the
MultipleObjectsReturned error. After, the new test passes successfully.

Description From Last Updated

"replies", technically.

chipx86chipx86

Single quotes?

chipx86chipx86

Can we do "Testing ReviewsManager.get_pending_reply ..." to provide context? I know the other doesn't do that, but it's also very …

chipx86chipx86
chipx86
  1. 
      
  2. reviewboard/reviews/managers.py (Diff revision 1)
     
     
    Show all issues

    "replies", technically.

  3. reviewboard/reviews/managers.py (Diff revision 1)
     
     
     
    Show all issues

    Single quotes?

  4. Show all issues

    Can we do "Testing ReviewsManager.get_pending_reply ..." to provide context? I know the other doesn't do that, but it's also very old.

  5. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (2b57653)