Marking bug report as duplicate of its duplicate using the API causes endless loop, DB timeouts

Bug #347229 reported by Matthew Paul Thomas
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Eleanor Berger

Bug Description

Using the web UI (which uses the LP.API via the form overlay):

1. Open a bug report that has a duplicate.
2. Click "Mark as duplicate".
3. Type the number of the bug report that is the duplicate of this one.
4. Press Enter.

What happens:
4. The duplicate form disappears.
5. A small spinner appears next to the "Mark as duplicate" link for several seconds.
6. The dialog reopens, displaying a massive amount of SQL gibberish in red.

What should happen:
3. Instantly upon entering a number equal to that of a bug report that was a duplicate of this one when this page was loaded, the Confirm button should be disabled and Launchpad should show an error caption under the bug number field explaining why you can't do that. (The page already lists which bug reports are duplicates of this one, so this would not require any extra effort from the database.)
4. If there's a possibility that it will need to be visible in a few seconds, the duplicate form should not disappear in the first place.
6. If the pre-emptive error prevention didn't work (for example, if someone else marked Y as a duplicate of X while you had X open in preparation for marking it as a duplicate of Y), the error should be in English rather than SQL.

---

Using launchpadlib:

{{{
bug = lp.bugs[147229]
bug.duplicate_of = bug
bug.lp_save()
}}}

results in an endless loop followed by a DB timeout.

Tags: api lp-bugs
Revision history for this message
Matthew Paul Thomas (mpt) wrote :
Revision history for this message
Graham Binns (gmb) wrote :

Updated the description. We need to have better checking on setting duplicate_of via the webservice API.

summary: - Marking bug report as duplicate of its duplicate displays epic SQL
- jargon
+ Marking bug report as duplicate of its duplicate using the API causes
+ endless loop, DB timeouts
Changed in malone:
importance: Undecided → High
milestone: none → 2.2.3
status: New → Triaged
description: updated
tags: added: api
Changed in malone:
assignee: nobody → intellectronica
Changed in malone:
status: Triaged → In Progress
Revision history for this message
Eleanor Berger (intellectronica) wrote :

Fixing this in the API for now, but I agree with ~mpt that ideally the widget should know about the duplicate chain and prevent you from submitting nonsense.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

The validation is not in browser code like we assumed. It is supposed to be done by the field, DuplicateBug. I'm not sure why it isn't happening automatically.

Revision history for this message
Björn Tillenius (bjornt) wrote : Bug fixed by a commit

Fixed in devel r8073.

Changed in malone:
status: In Progress → Fix Committed
Changed in malone:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.