Repository navigation
fix(flags): explain silent cohort non-match in flag evaluation - #83866
trunk-io[bot] merged 4 commits into
Conversation
A flag targeted at a behavioral or realtime cohort could report a bare no-match, which reads as a correct negative even when the cohort's member list shows the person as present. The evaluator cannot fully resolve those cohorts (behavioral or lifecycle leaves are skipped on the dynamic path, and a realtime-routed cohort is a non-member when realtime evaluation is off). Add a distinct FeatureFlagMatchReason, NoConditionMatchCohortNotEvaluated, returned when a targeted cohort with a behavioral or lifecycle condition decides the non-match. It still serializes as no_condition_match for backward compatibility, and carries an enriched description, mirroring the existing NoConditionMatchGroupsNotEvaluated pattern. Forward that description through the evaluation_reasons and flag-test endpoints, and surface it in the person profile flags tab and the flag tester so the non-match is explained rather than looking correct. Generated-By: PostHog Desktop Task-Id: 5274be96-cfc3-40cb-b2ee-db0a190ff6bf
|
😎 Merged successfully - details. |
🤖 CI report
|
| Root | Eager (shipped) | Δ vs base | Budget |
|---|---|---|---|
entry (logged-out pages, app bootstrap)src/index.tsx |
1.36 MiB · 22 files | no change | ███░░░░░░░ 30.2% of 4.51 MiB |
authenticated shell (every logged-in page)src/scenes/AuthenticatedShell.tsx |
8.77 MiB · 3,235 files | no change | █████████░ 90.2% of 9.71 MiB |
🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
Largest files eagerly shipped from src/index.tsx
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 762 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 306.5 KiB | ../node_modules/.pnpm/posthog-js@1.418.17/node_modules/posthog-js/dist/rrweb.js |
| 267.7 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 258.5 KiB | ../node_modules/.pnpm/posthog-js@1.418.17/node_modules/posthog-js/dist/module.js |
| 246.0 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 154.2 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 104.6 KiB | src/lib/api.ts |
| 95.1 KiB | ../packages/quill/packages/quill/dist/index.js |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 90.6 KiB | ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Toolbar bundle — eager 2.25 MiB within budget
What the toolbar ships to customer pages, measured from the esbuild output (minified, post-tree-shake). The eager set is the entry plus everything statically imported from it — fetched before any feature runs; deferred chunks load lazily. The eager guardrail is 5.72 MiB. Each output file must also stay below 10 MB, where CloudFront stops compressing it. The module boundary is enforced separately by check-toolbar-graph.
| Metric | Size | Δ vs base | Budget |
|---|---|---|---|
| Eager (shipped) entry + static imports |
2.25 MiB · 17 files | no change | ████░░░░░░ 39.3% of 5.72 MiB |
| Deferred (lazy) | 2.09 MiB · 33 files | no change | n/a — loads on demand |
Loader dist/toolbar.js |
1.1 KiB | no change | █░░░░░░░░░ 5.8% of 19.5 KiB |
Largest eagerly-shipped chunks
| Size | File |
|---|---|
| 745.7 KiB | dist/toolbar/toolbar-app-XJGYQ44O.css |
| 582.9 KiB | dist/toolbar/chunk-chunk-YRYIO5AK.js |
| 484.6 KiB | dist/toolbar/chunk-chunk-7TYJBGPX.js |
| 133.8 KiB | dist/toolbar/chunk-chunk-HUJ6YVZZ.js |
| 131.8 KiB | dist/toolbar/chunk-chunk-T5KY5WYR.js |
| 71.2 KiB | dist/toolbar/toolbar-app-2USHGT3U.js |
| 69.0 KiB | dist/toolbar/chunk-chunk-27JL52RE.js |
| 35.6 KiB | dist/toolbar/chunk-chunk-5I6DF2DA.js |
| 20.9 KiB | dist/toolbar/chunk-chunk-WRHMR2RW.js |
| 12.2 KiB | dist/toolbar/chunk-chunk-PIK3PADE.js |
Posted automatically by check-toolbar-size · sizes are toolbar output bytes (shipped, post-tree-shake) from the esbuild metafile
✅ Dist folder size — 🔺 +6.6 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1460.19 MiB · 🔺 +6.6 KiB (+0.0%)
⚠️ Playwright — 1 flaky
🎭 Playwright report · View test results →
- Inline editing insight title via compact card popover (chromium)
These issues are not necessarily caused by your changes.
Annoyed by this section? Help fix flakies and failures and it will go green!
⚠️ Backend snapshots — 1 updated (1 modified, 0 added, 0 deleted)
Query snapshots: Backend query snapshots updated
Changes: 1 snapshots (1 modified, 0 added, 0 deleted)
What this means:
- Query snapshots have been automatically updated to match current output
- These changes reflect modifications to database queries or schema
Next steps:
- Review the query changes to ensure they're intentional
- If unexpected, investigate what caused the query to change
✅ ClickHouse migration SQL — none
No ClickHouse migrations in the latest push.
Shorten the multi-line comments added for the cohort non-match reason to at most two lines each, keeping the why and dropping the restated detail. Generated-By: PostHog Desktop Task-Id: da3a77ad-8157-4394-8389-4f980e248485
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. |
Problem
no_condition_match, indistinguishable from a genuine negative, so the disagreement between flag evaluation and the cohort's precomputed member list stayed invisible.Changes
FeatureFlagMatchReason::NoConditionMatchCohortNotEvaluated, returned fromis_condition_matchwhen a targeted cohort with a behavioral or lifecycle condition decides the non-match.no_condition_matchfor backward compatibility and carries an enricheddescription, mirroring the existingNoConditionMatchGroupsNotEvaluatedreason.NoConditionMatch, so trustworthy negatives are not relabeled.descriptionthrough theevaluation_reasonsand flag-test endpoints.no_condition_match(unchanged)no_condition_match+ description explaining the divergenceHow did you test this code?
NoConditionMatch.hogli build:openapi); the only generated changes are the addedreason_descriptionfield.Automatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Fully autonomous
/improving-drf-endpoints,/writing-tests,/writing-user-facing-copy,/writing-code-comments,/writing-pr-descriptions.evaluate_single_cohortdeserialize-failure path is guarded upstream byextract_dependencies. The remaining live symptom is the silent non-match for behavioral and realtime cohorts. This PR makes that non-match explainable without changing match behavior, deliberately staying clear of the realtime-cohort membership work tracked in other issues.Created with PostHog Desktop from this inbox report.