Skip to content

Raise error/test failure if track_event call tries to track undefined additional property

Problem

With Allow more than 3 additional properties in Inte... (#462378 - closed) • Niko Belokolodov • 17.3 we're allowing more than 3 properties to be defined. This increases the chance that a typo or similar happens when sending a property. Such typos can lead to metrics not being calculated correctly or other problems in analysis

Desired Outcome

Our testing helpers and/or method calls automatically catch if a tracking call tries to track a property that is not defined in the definition

Potential Solution

  • update config/events/schema.json to conditionally apply additionalProperties: false if either label or property is undefined
  • update app logic to raise an error in dev or test if an event is triggered with a property not included in the definition

How to verify

Further actions needed

Edited by Michał Wielich