When you call mw.eventLog.logEvent() or efLogServerSideEvent(), EventLogging validates your event against its schema, but you don't know if it passed validation. One use case for needing this is campaign tracking: ?campaign=someName should only set a cookie if someName is an active campaign, which we track as an enum in the schema.
As a workaround, browser clients can call mw.eventLog.isValid() and server clients can duplicate the code to get the RemoteSchema and pass it to efSchemaValidate() , but it's duplicating code and recalculating something EventLogging already knows. Re-fetching the schema seems expensive.
Perhaps the log functions could have an optional out parameter that returns isValid(). Or, they could have an optional parameter to return the encapsulated event, which includes clientValidated. Or the functions could memoize the last validation they performed so a subsequent isValid()/efValidateEvent() of the same event is fast.
Version: unspecified
Severity: normal