AssertionError triggered renewing team membership

Bug #230801 reported by Diogo Matsubara
8
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Edwin Grubbs

Bug Description

As seen in OOPS-865C2562, an AssertionError was triggered while renewing an expired membership of a team
Exception type AssertionError
Exception value This membership can't be renewed by the member himself.

More: OOPS-1144A1730

Related branches

Revision history for this message
Guilherme Salgado (salgado) wrote :

So, either the user manually crafted the URL or the team changed its renewal policy from ONDEMAND (meaning members can renew) to something else (AUTOMATIC, it seems) in between the expiration warning being sent to the user and him following the link to renew the membership.

Changed in launchpad:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Christian Reis (kiko) wrote :

Is that page being rendered for the user, then, even though he can't renew it?

Revision history for this message
Guilherme Salgado (salgado) wrote : Re: [Bug 230801] Re: AssertionError triggered renewing team membership

Good point; the page is not rendered when he can't renew it, so it must
have been a stale page. that would explain why the user didn't try
submitting the form one more time like they usually do (when he
refreshed the page the form wasn't rendered).

Revision history for this message
Curtis Hovey (sinzui) wrote :

The assertion appears to be the right response in this case so I am marking the bug as invalid.

Changed in launchpad-registry:
status: Confirmed → Invalid
Revision history for this message
Diogo Matsubara (matsubara) wrote :

The thing about AssertionError is that we record an OOPS and show an error page to the user, while we should be displaying a nice error message to the user and not recording an OOPS. I don't think this is invalid but likely to be low. What do you think Curtis?

Revision history for this message
Curtis Hovey (sinzui) wrote :

Understood. I agree then we want to remove the oops report.

Changed in launchpad-registry:
status: Invalid → Triaged
Revision history for this message
Curtis Hovey (sinzui) wrote :

OOPS-1119ED453 happened when the user used the link in the email to renew his membership. The user reports that his membership was renewed, but reading the code, I can see that it is not possible. Looking at ~motu/+membership, I can see the user is indeed not expired.

Both the model object and the template check TeamMembership.canBeRenewedByMember() to determine the message to display to the user and whether to render the action button. The method checks that the expiration date is less than the limit.

So this oops could be recreated by using the action, then reloading the page while the action is inprogress, such as double-clicking on the submit button.

I propose that the action check canBeRenewedByMember() to abort early. The page will display the state of the membership to inform the user that the renewal did happen.

Revision history for this message
Guilherme Salgado (salgado) wrote :

That sounds like a plan to me.

Ursula Junque (ursinha)
description: updated
Revision history for this message
Curtis Hovey (sinzui) wrote :

There is a new occurrence of this: OOPS-1430EA1286. I think this too will be fixed by making the action check canBeRenewedByMember() to abort early.

Changed in launchpad-registry:
milestone: none → 3.1.12
Changed in launchpad-registry:
assignee: nobody → Edwin Grubbs (edwin-grubbs)
Changed in launchpad-registry:
status: Triaged → In Progress
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote : Bug fixed by a commit
Changed in launchpad-registry:
status: In Progress → Fix Committed
Changed in launchpad-registry:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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