fix(cdp): clear empty event ingestion filters#2
Open
lordspline wants to merge 3 commits into
Open
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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
Event ingestion filtering let users create drop rules, but deleting the last rule left the saved filter stuck because the UI treated the empty editor state as invalid instead of an intentional delete-all action.
Fixes PostHog#62507.
Changes
mode=disabled,filter_tree=null, and no test cases.All conditions must have a value.filter_tree=nullresponses into the empty editor group so users can immediately add new filters again.How did you test this code?
hogli test frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.test.ts.hogli test posthog/api/test/test_event_filter_config.py posthog/models/test/test_event_filter_config.py.ruff check posthog/api/event_filter_config.py posthog/models/event_filter_config.py posthog/api/test/test_event_filter_config.py posthog/models/test/test_event_filter_config.py.pnpm exec oxlint --quiet frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.test.ts.mode=disabled,filter_tree=null, andtest_cases=[].pnpm --filter=@posthog/frontend typescript:check; it fails before reaching this change because the local checkout is missing generated Kea type files in unrelated paths such assrc/exporter/ExporterLoginTypeandsrc/layout/FeaturePreviews/featurePreviewsLogicType.👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Automatic notifications
Docs update
No docs update needed; this preserves the existing event ingestion filtering UI/API shape and fixes delete-all persistence semantics.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Captain Capy implemented and verified this issue end to end. The key decision was to distinguish empty filter trees (intentional delete-all) from non-empty condition leaves with empty values (incomplete input), then enforce that semantic in both frontend serialization and backend persistence.