Last modified: 2014-02-26 12:55:24 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 T46454, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44454 - efSchemaValidate permits unrecognized additional fields
efSchemaValidate permits unrecognized additional fields
Status: RESOLVED FIXED
Product: Analytics
Classification: Unclassified
EventLogging (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Ori Livneh
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-29 02:10 UTC by spage
Modified: 2014-02-26 12:55 UTC (History)
9 users (show)

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


Attachments

Description spage 2013-01-29 02:10:42 UTC
If you add additional fields to your event that aren't in the schema+id you specify, efLogServerSideEvent nevertheless logs the event with isValid: true.

In the same situation client-side logEvent() will log with isValid: false and a warning "Unrecognized property: (bogus field's name)".

Depending on how json2sql handles this, the event won't be inserted in the SQL table, or will generate a set of table columns unsuitable for future events.

To reproduce, just add a "boGUSNewKEY" => 666,  to a server-side event in PHP.
Comment 1 Ori Livneh 2013-01-29 08:03:22 UTC
This is permitted by the JSON Schema draft v3:

> 5.4.  additionalProperties
>
> This attribute defines a schema for all properties that are not
> explicitly defined in an object type definition.  If specified, the
> value MUST be a schema or a boolean.  If false is provided, no
> additional properties are allowed beyond the properties defined in
> the schema.  The default value is an empty schema which allows any
> value for additional properties.

<http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4>

Nevertheless, this bug is valid, because:
1) Client-side and server-side validation should behave the same way
2) A stricter interpretation of the draft in which additional values are disallowed seems sensible.
Comment 2 Ori Livneh 2013-01-29 08:53:55 UTC
Patch in Gerrit: https://gerrit.wikimedia.org/r/#/c/46501/
Comment 3 Alex Monk 2013-02-03 17:38:05 UTC
Merged by Ori on the 29th.
Comment 4 Andre Klapper 2014-02-26 12:55:24 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