Looping messagebox if you cancel a purchase

Bug #696861 reported by Adnane Belmadiaf on 2011-01-03
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Software Center Agent
Michael Nelson
software-center (Ubuntu)
Gary Lasker

Bug Description

Binary package hint: software-center

How to reproduce :
- try to buy a software
- login to the SSO,
- then do not pay and just click "Cancel"
You will see a message that will appear every X seconds telling you that "Failure in the purchase process".
PS : i am using the trunk branch

Adnane Belmadiaf (daker) wrote :
Adnane Belmadiaf (daker) wrote :
Michael Vogt (mvo) wrote :

This sounds like the software-center-agent is not generating the right json callback when the payment is canceled. It seems to set "failures" to "Payment status returned by payment service was CANCELLED" but not set the user_canceled property to true.

Changed in software-center (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Changed in software-center-agent:
status: New → Confirmed
importance: Undecided → Low
tags: added: kb-task
Changed in software-center-agent:
assignee: nobody → Michael Nelson (michael.nelson)
status: Confirmed → In Progress
Michael Nelson (michael.nelson) wrote :

Hi Adnane! I can reproduce something like you've described above, but not the exact details.

I'm running lucid. If I:

 1. Open software-center, browse to "For Purchase"->Brukkon, and click Buy...
 2. Log in
 3. Click Cancel on the payment screen as in your screenshot (although my payment screen is in a separate window - I'm guessing you're testing SCA on natty?)

I don't see any looping - Isee very briefly the 'Processing payment' screen (which is required, as the SC-server side doesn't even know the payment is canceled until we request the payment status from payments*), and then a dialog saying 'Failure in the purchase process' (attaching screenshot).

@mvo: do you know what might have caused this change in behaviour? AFAICS, we've not sent any user_canceled property in the title for canceled purchases previously (I can see it was added to the login cancel, but that's it). If that's the best solution I can add it in here too.

Michael Nelson (michael.nelson) wrote :

mvo, achuni: actually, is this even a bug in SCA? Isn't the behaviour that I get above using software-center in lucid the expected behaviour?

(Note: we have talked about improving the way the errors are handled, but AFAIK that requires the client polling the payment status itself, rather than the server - bug 622732).

Adnane Belmadiaf (daker) wrote :

@Michael, yes it's the same issue, note that i was running USC from the trunk (rev 1400) on Maverick .

Michael Nelson (michael.nelson) wrote :

@Adnane - when you are running trunk USC, do you know whether it is pointing to the production software center server, or staging?

Michael Nelson (michael.nelson) wrote :

Sorry - and the machine I tested above on was obviously maverick, not lucid.

Adnane Belmadiaf (daker) wrote :

@Michael , how do i know which server ? if you look at comment #3 you will see the terminal output, btw i have that :
** Message: console message: https://pay.ubuntu.com/checkout/710d0d545e6d094a19e78bbc3bf38f09/ @61: TypeError: Result of expression 'Y' [undefined] is not an object.
so i guess it's production.

Thanks Adnane. I've just had a bit more time to look at this.

I can reproduce this error with the current software-center client trunk r1492 (that is, after dismissing the error shown in http://launchpadlibrarian.net/61572488/message-loop.png it re-appears after a few seconds). Just to be clear, I've attached a quick video showing the issue.

@mvo: This doesn't happen with the client in maverick, and the client is getting the title change as it was in maverick also. My guess is that, although the browser window is no longer displayed, it is still there, reloading every 3 seconds and triggering the title-change event.

Regarding a *better* error message than 'Failure in the purchase process', I've just confirmed with ricardo and can update the template to include user_cancelled variable (it's not currently included in that template at all - only during the openid cancel). I'll also update the template so the user isn't shown "Purchasing 'whatever'" when they've just clicked cancel (as a temporary solution until bug 622732 is fixed).

Changed in software-center-agent:
status: In Progress → Fix Committed
Changed in software-center (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Gary Lasker (gary-lasker)
Gary Lasker (gary-lasker) wrote :

Hi Michael, I just wanted to confirm whether you've indeed implemented the "user_canceled" property (note spelling) as you mention in comment #11. When we get this property in software-center, we simply cancel out of the transaction cleanly and we don't show a dialog (which we do in the case of a failure where we display a dialog with the failure text, in this case, "Payment status returned by payment service was CANCELLED").

I see the status of the agent task is still "Fix Committed", so I assume we just haven't rolled out this fix yet. Is that correct?

I have a fix in the works for the looping dialogbox in the client. Your guess in comment #11 is spot-on; with the new "integrated" purchase workflow in Natty we are simply hiding the webkit window and so it continues to process the title change events every 3 seconds, and in this case, each time showing a new error dialog.


Gary Lasker (gary-lasker) wrote :

Also see related bug 641321.

Gary Lasker (gary-lasker) wrote :

Hey again Michael! Never mind the first part of my comment #12. I took a look at the your agent branch and I can see that you've implemented a "user_cancelled" property for this case, so I've added support for that in software-center in the attached branch.

I can see that this fix is not yet deployed as I'm still seeing the following result when canceling from the payment screen:

  {'successful': False, 'failures': 'Payment status returned by payment service was CANCELLED'}

Thanks again!

Changed in software-center (Ubuntu):
status: In Progress → Fix Committed

On Thu, Mar 31, 2011 at 4:42 AM, Gary Lasker <email address hidden>wrote:

> Hey again Michael! Never mind the first part of my comment #12. I took a
> look at the your agent branch and I can see that you've implemented a
> "user_cancelled" property for this case, so I've added support for that
> in software-center in the attached branch.
> I can see that this fix is not yet deployed as I'm still seeing the
> following result when canceling from the payment screen:

Yes, sorry - it has been a long time since an sca deploy unfortunately... we
hope to deploy soon. You should be able to confirm the expected
user_cancelled on staging though.

Launchpad Janitor (janitor) wrote :
Download full text (3.7 KiB)

This bug was fixed in the package software-center - 3.1.25

software-center (3.1.25) natty; urgency=low

  [ Kiwinote ]
  * data/ui/SoftwareCenter.ui:
    - mark the back/forward actions as translatable (LP: #742129)
  * softwarecenter/db/database.py,
    - make custom lists work (LP: #712903)
  * softwarecenter/app.py,
    - when the supported filter is set to supported_only, navigate up if:
      - we are in a details view of an app which is not supported (LP: #480827)
      - we are in a list view which becomes empty
  * softwarecenter/app.py,
    - correctly count the nr of apps displayed in the recommended category and
      update it when needed (LP: #735634)
    - only display subcategories if they are non-empty (LP: #419270)
  * softwarecenter/backend/weblive.py:
    - don't crash if we try to delete a non-existent file (LP: #743511)
  * softwarecenter/db/reviews.py,
    - fallback to ReviewLoaderJsonAsync when we can't use multiprocessing
      (LP: #741069)
    - fixes to make ReviewLoaderJsonAsync 'work' (ie most common cases)
  * softwarecenter/db/update.py:
    - don't import softwarecenter.log
  * softwarecenter/view/appdetailsview_gtk.py:
    - don't draw random boxes when we have an error layout (LP: #739269)
    - retire share button as we now have full microblogging support in the
      review dialog (LP: #592619, LP: #743765)
  * softwarecenter/view/appview.py:
    - correctly refresh listview when supported filters are changed
  * softwarecenter/view/catview.py:
    - if a category has subcategories, then category.query should include all
      items included in the subcategories, not a subset of these
  * softwarecenter/view/widgets/pathbar_gtk_atk.py:
    - avoid having a half-height pathbar (LP: #743614)
  * refresh .pot file

  [ Gary Lasker ]
  * softwarecenter/view/widgets/reviews.py:
    - fix crash if app_version is not defined when
      calling upstream_version_compare (LP: #746120)
  * softwarecenter/view/purchaseview.py:
    - disconnect webkit signal handlers when the webkit view
      is not showing (LP: #696861)
    - support 'user_cancelled' from the software-center-agent
      (LP: #641321)
  * softwarecenter/view/softwarepane.py,
    - animate the action bar show/hide
  * softwarecenter/view/appview.py:
    - in the AppViewFilter, also consider apps in the for-purchase
      channel as available; this allows them to show up in
      e.g. What's New (LP: #746679)

  [ Michael Vogt ]
  * softwarecenter/db/update.py:
    - ensure the iconname that comes from the software-center-agent
      does not contain a ".", the icon cache gets confused otherwise
  * merged lp:~evfool/software-center/sfix672229, many thanks to
    Robert Roth (LP: #672229)
  * merged lp:~alexeftimie/software-center/fix-704719-briefly-wrong-display,
    many thanks to Alex Eftimie (LP: #704719)
  * softwarecenter/view/purc...


Changed in software-center (Ubuntu):
status: Fix Committed → Fix Released
tags: added: sp-1
tags: added: kb-defect
removed: kb-task
Dave Morley (davmor2) wrote :

Slight issue in that the window doesn't close. However noodles thinks his fix available in the next round fixes this however you can simply close the bread crumb link and then click on for purchase.

Currently bug 770718 means that when cancelling a purchase, the json in the title is invalid (unparsable as json) which may cause the SC client to leave the window open. This bug has been fixed, but not yet deployed to staging.

Changed in software-center-agent:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers