Last modified: 2014-02-26 12:55:14 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 T45550, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43550 - events log with _ok: true even with validation errors
events log with _ok: true even with validation errors
Status: RESOLVED FIXED
Product: Analytics
Classification: Unclassified
EventLogging (Other open bugs)
unspecified
All All
: Unprioritized minor
: ---
Assigned To: Ori Livneh
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-01 07:19 UTC by spage
Modified: 2014-02-26 12:55 UTC (History)
8 users (show)

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


Attachments

Description spage 2013-01-01 07:19:49 UTC
mw.eventLog.logEvent( 'CommunityPortal', {  } );
will log with _ok: true despite obvious schema violations and the console warning (if ?debug=1):
  Missing "token" property

This happens because the $.each( properties, ...) iterator in validate() in modules/ext.eventLogging.core.js does not propagate a return false from a property test; it halts iteration but the validate() function continues on and returns true.

I'm puzzled that the qunit tests of validate in <http://localhost/wiki/index.php/Special:JavaScriptTest/qunit?module=ext.EventLogging> all pass. They, e.g. assert.throws(... /Missing/), and even though validate() doesn't throw errors any more, they all pass.

BTW, it would be nice if the mw.eventLog.schemas.<Name>.logged included the system fields such as _ok.
Comment 1 spage 2013-01-01 07:31:01 UTC
Gerrit change #41826 helps.

I think the self.warn() warnings in validate() must trigger an exception in qunit testing, so the tests pass even though in normal operation validate() doesn't cause an exception.  Seems like a qunit misfeature.
Comment 2 Matthew Flaschen 2013-01-01 23:42:36 UTC
Ori wrote some custom test setup code (https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/EventLogging.git;a=blob;f=tests/ext.eventLogging.tests.js;h=87ac1406cd1592a8351bcb22250fee338a2d8b83;hb=HEAD#l26) to convert warn to Errors.  

Like most monkey patching, it's pretty confusing until you find the code.
Comment 3 Andre Klapper 2014-02-26 12:55:14 UTC
[moving from MediaWiki extensions to Analytics product - see bug 61946]

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


Navigation
Links