Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(experiments): trigger recalculation when metric count does not match results. (#65309)

Rodrigo Iloro103419105758
diff --git a/frontend/src/scenes/experiments/experimentMetricsLogic.ts b/frontend/src/scenes/experiments/experimentMetricsLogic.ts
index 64abaecfc4d7..d6233fe09d7d 100644
--- a/frontend/src/scenes/experiments/experimentMetricsLogic.ts
+++ b/frontend/src/scenes/experiments/experimentMetricsLogic.ts
@@ -359,6 +359,18 @@ export const experimentMetricsLogic = kea<experimentMetricsLogicType>([
return
}
+ /**
+ * We have no per-metric staleness signal, so a results + failures count short of the total
+ * means a shared metric diverged: re-run to heal it.
+ */
+ if (
+ recalculation.status === RECALCULATION_STATUSES.completed &&
+ recalculation.completed_metrics + recalculation.failed_metrics < recalculation.total_metrics
+ ) {
+ actions.triggerRecalculation('config_change')
+ return
+ }
+
/**
* if the recalculation resutls are stale, trigger a new recalculation
* without hiding the existing resutls.