Skip to content

Show the error message when event definition is missing for event

Michał Wielich requested to merge michold-unknown-event-errors into master

What does this MR do and why?

Related to #434142 (closed)

Display an error message when an unknown event is used during development.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

To test it, we will need to track a frontend InternalEvent that is not defined in the codebase and inspect the return error.

Here's an example scenario:

  1. In this file, substitute user_viewed_dashboard_list for a value that is not a name of any defined event, for example asdasdasd
  2. Enter the analytics dashboard screen. This may require some more GDK setup: enabling SaaS mode and/or the combined_analytics_dashboards feature flag
  3. Search for track_event requests in the Chrome dev tools
  4. This should be a 422 status request with its error message mentioning that the event is not known.
  5. Undo the changes in the .js file, bringing back the defined event name
  6. Retrigger the event by refreshing the analytics dashboard view
  7. This should generate another /track_event request, this time it should have a 200 status.
Edited by Michał Wielich

Merge request reports