Last modified: 2014-09-11 18:58:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56486, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54486 - Badge clicks takes too long to give some feedback to the user
Badge clicks takes too long to give some feedback to the user
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Echo (Other open bugs)
master
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-24 00:55 UTC by Helder
Modified: 2014-09-11 18:58 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Network tab on Google Chrome: the api query took 6.78 seconds (125.10 KB, image/png)
2013-09-24 10:28 UTC, Helder
Details
pt.wikipedia.org.har (19.22 KB, application/octet-stream)
2013-09-24 10:31 UTC, Helder
Details

Description Helder 2013-09-24 00:55:42 UTC
When I click in the link "[1]" which appears when I have a new notification, it takes a long time until anything happens. The flyout (or a spinner, or anything) should appears immediately when the user clicks on this badge. Sometimes it takes more than a second.
Comment 1 MZMcBride 2013-09-24 04:41:21 UTC
I don't know if any intentional delay has been placed on clicking the link in personal tools. I doubt it, but it's certainly possible.

Unless we absolutely must, we should avoid implementing a spinner. Ideally notifications should just be instant and should just work.

Do you have any means of measuring how long opening the notifications window takes currently?
Comment 2 Kunal Mehta (Legoktm) 2013-09-24 04:54:26 UTC
I looked at my browser console, and it seems that every time you click the icon, it makes an API request to fetch your notifications, which is probably causing the delay.

Also, if you click the icon, have the flyout show up, then hide it again, and click the icon a second time, it makes another API request, causing the same delay.
Comment 3 MZMcBride 2013-09-24 06:13:26 UTC
I wonder if this is one of those situations where it's a choice between a small delay and fully up-to-date data or possibly out-of-date data but immediate (locally cached) data.
Comment 4 Helder 2013-09-24 10:28:44 UTC
Created attachment 13356 [details]
Network tab on Google Chrome: the api query took 6.78 seconds

Screenshot taken from
https://pt.wikipedia.org/wiki/Special:BlankPage
Comment 5 Helder 2013-09-24 10:31:38 UTC
Created attachment 13357 [details]
pt.wikipedia.org.har

The har file with the data from previous test.
Comment 6 spage 2013-10-03 18:23:24 UTC
Prioritization and scheduling of this bug is tracked on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/280
Comment 7 Gerrit Notification Bot 2013-11-01 21:41:40 UTC
Change 93115 had a related patch set uploaded by Bartosz Dziewoński:
ext.echo.overlay: Show a spinner while waiting for data [WIP]

https://gerrit.wikimedia.org/r/93115
Comment 8 Gerrit Notification Bot 2013-11-21 23:28:37 UTC
Change 93115 abandoned by Bartosz Dziewoński:
ext.echo.overlay: Show a spinner while waiting for data [WIP]

https://gerrit.wikimedia.org/r/93115
Comment 9 Bartosz Dziewoński 2013-11-21 23:28:57 UTC
Actually, I don't really have the time nor the incentive to finish working on this, sorry. Anyone can feel free to pick it up.
Comment 10 Helder 2014-08-26 20:48:22 UTC
A new record: 5 seconds until it showed me anything!? A little too much, I think...
Comment 11 bsitu 2014-08-26 23:00:35 UTC
Under my profiling with xdebug, most of the time is spent in wikitext parsing, generating pretty timestamp etc.  With the tab separation, we are displaying 25 items max per tab which is almost 6 times the number we used to display in the overlay.  More records means more time to process, this is expected.  However, I haven't never seen a record of 5 seconds, this is way higher than what I see in mediawiki ( with 25 flow notifications + 15 other notifications ).  Does this happen at consistent matter? 

If this is really a problem, we could find a way to cache the entire notification to skip the parsing.
Comment 12 Helder 2014-08-26 23:34:32 UTC
Wouldn't be possible to show the box immediately with a static content such as "Loading..." and let that text be replaced by the actual content when it is ready? This way the interface would be a little more responsive, and the user would know that there is something being processed instead of being tempted to click in the link again (unnecessarily). Even if it usually takes one second until the whole content is available, when it takes more than that, it is a little confusing.
Comment 13 Kunal Mehta (Legoktm) 2014-08-27 22:07:15 UTC
It just took me 15 seconds for the API request for my flyout to open on meta.
Comment 14 Bartosz Dziewoński 2014-08-27 22:22:57 UTC
(This bug seems to conflate two issues:
* The API requests take too long to complete
* The UI doesn't provide any clue that an API request is in progress
Do about that what you will, just noting.)
Comment 15 bsitu 2014-08-27 22:55:38 UTC
Besides the time in wikitext, timestamp parsing, it could be related to this: the flyout is now separated into two tabs: message + alert, data is retrieved via two lookup queries via notification types, if you have massive amount of alert notification and only one flow notification, the lookup has to scan through all notification to get, say like 10 flow notifications.  I didn't really expect such cases and user would have tons of notifications.  If I have known this, I would have vetoed the tab separation from the very beginning, :)

There are a couple of things we can do, one attempt is to clear old notifications to keep the volume low.

The other possible solution is to denormalize notification table by adding event_type along with indexes.
Comment 16 Kunal Mehta (Legoktm) 2014-08-27 23:17:22 UTC
(In reply to bsitu from comment #15)
> Besides the time in wikitext, timestamp parsing, it could be related to
> this: the flyout is now separated into two tabs: message + alert, data is
> retrieved via two lookup queries via notification types, if you have massive
> amount of alert notification and only one flow notification, the lookup has
> to scan through all notification to get, say like 10 flow notifications.  I
> didn't really expect such cases and user would have tons of notifications. 
> If I have known this, I would have vetoed the tab separation from the very
> beginning, :)

On places like meta and enwp where Flow is only on one or two test pages, most active? users will have lots of normal notifications, but very few Flow ones.
Comment 17 Erik Bernhardson 2014-08-27 23:39:07 UTC
As a first step, it seems the appropriate bits of code need to be instrumented and the production profile logs need to be reviewed to see where the time is really spent.  My only worry is we might need to let echo go to bigger wiki's for enough profiling data to be collected?
Comment 18 bsitu 2014-08-27 23:42:24 UTC
(In reply to Erik Bernhardson from comment #17)
> As a first step, it seems the appropriate bits of code need to be
> instrumented and the production profile logs need to be reviewed to see
> where the time is really spent.  My only worry is we might need to let echo
> go to bigger wiki's for enough profiling data to be collected?

Yeah, adding the profiling code to the API is the first step.  If meta takes 15 seconds to run, I think that should be enough for us to see where the time is spent
Comment 19 Helder 2014-08-28 18:38:34 UTC
(In reply to Kunal Mehta (Legoktm) from comment #13)
> It just took me 15 seconds for the API request for my flyout to open on meta.

I just saw it take 15+ seconds on enwikisource too.
Comment 20 Erik Bernhardson 2014-08-28 18:48:18 UTC
hmm, flow isn't even on enwikisource so the problem isn't directly related to the alert/message split.  Something else is going on. 

Also I just merged https://gerrit.wikimedia.org/r/#/c/156737/ from bsitu which will add a few profiling metrics to the api call which will show up at graphite.wikimedia.org

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links