Last modified: 2014-06-26 22:06:07 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 T58426, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56426 - Image link clicks might not get logged
Image link clicks might not get logged
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
MultimediaViewer (Other open bugs)
unspecified
All All
: Normal trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 42815 52287
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-31 20:06 UTC by Tisza Gergő
Modified: 2014-06-26 22:06 UTC (History)
3 users (show)

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


Attachments

Description Tisza Gergő 2013-10-31 20:06:26 UTC
This is a reminder to check whether the click logging works properly for image page links, which navigate the browser away. We use a 0.5 sec timeout to make sure the log request has enough time to lead before it would be aborted by the browser aborts it while unloading the page; this might be too little or unnecessarily much. See Mattflaschen's comment at https://gerrit.wikimedia.org/r/#/c/92445/ for more details.
Comment 1 Gilles Dubuc 2014-02-20 15:54:01 UTC
It's actually possible to make logging work on navigating away without a timeout by making a synchronous XHR call during the onbeforeunload. Browsers will abort an classic async one, but not a synchronous one. The drawback is that it freezes the page, but since the backend of event logging correctly aborts the request right away, it would be hardly felt. (I've already built something like that in production at dA).

This change would imply modifying (or overloading) mw.eventLog to make it do a synchronous XHR when needed instead of using an image object.

What do you think? Is the synchronous thing worth filing in Mingle?
Comment 2 Mark Holmquist 2014-02-20 19:31:13 UTC
I like this better than using timeouts that may not be enough. +1
Comment 3 Tisza Gergő 2014-02-20 19:50:56 UTC
Certainly a better solution as it does not take more time than necessary (I imagine on a fast connection way less than half sec is needed, so currently we are making the user wait for no reason). We can still set a timeout on the XHR object so this does not get too annoying for people with extremely slow connections.
Comment 4 Gilles Dubuc 2014-02-21 13:32:07 UTC
I've just realized that we don't need onbeforeunload, since we capture a specific click. We just need a callback/deferred to tell us when the .log() call is done. Conveniently, ext.eventLogging already provides that.

The technique I've described would be useful if we want to track people navigating away altogether (including entering a new URL in their browser). Worth keeping in mind, but not necessary for "site-link-click".

https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/255

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


Navigation
Links