fix(taxonomic-filter): skip entries without a name when caching prop defs#60835
Merged
sampennington merged 1 commit intoJun 1, 2026
Merged
Conversation
…defs When `infiniteListResultsReceived` updates the app-wide property-definition cache it mapped `results.results` straight into `Object.fromEntries(... [name, def])`. That list can include loading skeletons or undefined entries that have no `name`, which throws `TypeError: Cannot read properties of undefined (reading 'name')` or `Iterator value undefined is not an entry object`. Filter to entries that actually have a `name` before building the map. No change to ordering, promotion, or telemetry. Generated-By: PostHog Code Task-Id: 638adcb4-5133-4163-941d-ea061a572bf7
Contributor
|
Size Change: 0 B Total Size: 80.8 MB ℹ️ View Unchanged
|
Contributor
|
Reviews (1): Last reviewed commit: "fix(taxonomic-filter): skip entries with..." | Re-trigger Greptile |
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
The TaxonomicFilter throws two unhandled errors while processing loaded results —
TypeError: Cannot read properties of undefined (reading 'name')andIterator value undefined is not an entry object. Both originate ininfiniteListResultsReceived(taxonomicFilterLogic.tsx), where the app-wide property-definition cache is built:results.resultsis typed(TaxonomicDefinitionTypes | SkeletonItem)[]— loading skeletons (and occasionalundefinedentries) have noname, sopropertyDefinition.namethrows, and anundefinedentry makesObject.fromEntriesthrow "is not an entry object". Theas PropertyDefinition[]cast hides this from TypeScript.Changes
Filter
results.resultsto entries that actually have anamebefore building the cache map. This only affects what gets written into the cached property metadata — it does not touch result ordering, promotion (PROMOTED_PROPERTIES_BY_SEARCH_TERM), position-0 behaviour, tab rendering, or any telemetry payload shape.How did you test this code?
I'm an agent (PostHog Code). I have not run the build or tests in this environment (frontend dependencies are not installed here). Verification so far:
undefinedentries are excluded before.map/Object.fromEntries, and validPropertyDefinitions are cached exactly as before.A reviewer should run
pnpm --filter=@posthog/frontend typescript:checkandhogli test frontend/src/lib/components/TaxonomicFilter/, and confirm property metadata still caches correctly while a results list is mid-load.Automatic notifications
Docs update
Not needed.
🤖 Agent context
Authored by PostHog Code (Claude) while triaging high-volume unhandled frontend exceptions on insights pages; these two TypeErrors share this single root cause (skeleton/undefined entries leaking into the property-definition cache). Per the repo's
modifying-taxonomic-filterguidance, the change deliberately avoids ordering/promotion/telemetry — it is purely a defensive guard. A sibling PR fixes an unrelatedLemonDropdowncontains()crash found in the same triage. Agent-authored — requires human review; no manual browser testing was performed in the agent environment.