Show the error message when event definition is missing for event
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:
- In this file, substitute
user_viewed_dashboard_list
for a value that is not a name of any defined event, for exampleasdasdasd
- Enter the analytics dashboard screen. This may require some more GDK setup: enabling SaaS mode and/or the
combined_analytics_dashboards
feature flag - Search for
track_event
requests in the Chrome dev tools - This should be a 422 status request with its error message mentioning that the event is not known.
- Undo the changes in the
.js
file, bringing back the defined event name - Retrigger the event by refreshing the analytics dashboard view
- This should generate another
/track_event
request, this time it should have a 200 status.
Edited by Michał Wielich