fix: add missing funnel event types to resolve 422 errors - #579
Merged
Conversation
The FunnelEvent enum was missing 11 event types that the marketing-ui client sends (freedom_view, everything_view, trending_load_more, trending_comment/like/repost_attempt, trending_preset, trending_search, trending_view_toggle, join_view, join_click). FastAPI returned 422 validation errors when the client sent any unrecognized event.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Analytics endpoints returned 422 errors for
/analytics/funnelbecause theFunnelEventenum on the server was missing 11 event types that the marketing-ui client sends.Root Cause
FastAPI/Pydantic validates the
eventfield against theFunnelEventenum. When the client sent an unrecognized event (e.g.freedom_view,trending_load_more), validation failed with 422.Fix
Added all missing event types to
FunnelEventinmarketing/marketing-api/app/models.py:Notes
ERR_BLOCKED_BY_CLIENTerrors in the console are from ad blockers — separate issue, not fixable server-side.