Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 3 years ago

#3412 closed defect (bug) (fixed)

Clicking "Favorite" fast multiple times makes it go crazy and disappear!

Reported by: InterMike Owned by: boonebgorges
Milestone: 2.7 Priority: trivial
Severity: trivial Version:
Component: Activity Keywords: has-patch
Cc: alexander.berthelsen@…

Description

I clicked on "Favorite" about 20 times extremely fast, and it drove the My Favorites (#) way up. The only way to get rid of the extra Favorites is to click on "Remove Favorite" and to reload the page. (I still have have 1 Favorite that won't go away.)

Also, eventually, the Favorite button got dimmer, and dimmer, until completely disappearing altogether! LOL

Attachments (1)

3412.diff (710 bytes) - added by lakrisgubben 3 years ago.

Download all attachments as: .zip

Change History (12)

#1 @boonebgorges
8 years ago

  • Keywords close added

I'm able to reproduce this only if I click really, really fast.

This ticket combines two separate issues. The first is that fast button clicks make the button disappear. I don't know how to fix that; maybe by disabling the button until a response is received? I tried doing this, but because it's a link and not a true button, I wasn't able to make it work quite right.

The second issue is that the logic for the Favorites count is off. This is just because the number in the tab is incremented when you click, on the client side - it does not query for a new, updated Favorites count.

I'm tempted to say wontfix in both cases, as they're both such edge cases and are harmless anyway.

#2 @DJPaul
8 years ago

In the part of DTheme js near "Stream event delegation", the line beginning "target.fadeOut" in the callback can be amended like so to stop animations stacking:

target.stop(true, true).fadeOut( …

Not sure if it's a worthwhile change as in theory we'd ought to have do something similar on all other buttons that have a fadeOut.

#3 @johnjamesjacoby
8 years ago

  • Keywords needs-patch added; close removed
  • Milestone changed from Awaiting Review to 1.5
  • Version 1.5 deleted

Confirmed. The JS should check for the existence of the loading class before proceeding.

#4 @boonebgorges
8 years ago

  • Priority changed from normal to trivial
  • Severity changed from normal to trivial

I still say this is an edge case, and this ticket can be punted if no patch is readily available. I am not keen on going through all of the bp-default js at this point in the cycle and converting animations to callbacks.

#5 @DJPaul
8 years ago

I agree with Boone (that this is an edge case) and suggest punting it to 1.6.

#6 @johnjamesjacoby
8 years ago

  • Milestone changed from 1.5 to 1.5.1

Punting to 1.5.1.

#7 @boonebgorges
8 years ago

Punting to Future Release, pending a patch. (If it's going to require rewriting all of bp-default's JS, maybe we should mark wontfix)

#8 @boonebgorges
8 years ago

  • Milestone changed from 1.5.2 to Future Release

#9 @lakrisgubben
3 years ago

  • Cc alexander.berthelsen@… added
  • Keywords has-patch added; needs-patch removed

This is still a problem with latest BP (running 2016). The only real problem is with the favouriting "button" where as reported the count for "my favourites" goes crazy and BP makes loads of unnecessary requests to admin-ajax.php if someone clicks repeatedly on favourite. Attached is a super simple patch which just checks for the class "loading" and bails if that is set, works great as far as I can tell! :)

@lakrisgubben
3 years ago

#10 @boonebgorges
3 years ago

  • Milestone changed from Future Release to 2.7

This looks like a good fix to me. Thank you, @lakrisgubben !

#11 @boonebgorges
3 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 11109:

bp-legacy: Don't allow a Favorite click when AJAX request is in progress.

This change fixes a problem where multiple clicks in a row would
cause requests to back up and do weird things to the DOM.

Props lakrisgubben.
Fixes #3412.

Note: See TracTickets for help on using tickets.