: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(web-analytics): raise url change tracker threshold to reduce noise (#73124)
Carlos Marchal8865d793f336
diff --git a/frontend/src/lib/logic/scenes/urlChangeTracker.test.ts b/frontend/src/lib/logic/scenes/urlChangeTracker.test.tsindex 5dad6fbafdc2..0132360332de 100644--- a/frontend/src/lib/logic/scenes/urlChangeTracker.test.ts+++ b/frontend/src/lib/logic/scenes/urlChangeTracker.test.ts@@ -68,7 +68,7 @@ describe('getUrlChangeTracker', () => {const webTracker = getUrlChangeTracker('webAnalyticsLogic')const insightsTracker = getUrlChangeTracker('insightsLogic')- for (let i = 0; i < 6; i++) {+ for (let i = 0; i < 7; i++) {webTracker.recordChange('/web?foo=bar', 'webAnalyticsLogic', 'setFilters')}@@ -132,9 +132,9 @@ describe('UrlChangeTracker', () => {describe('isRapidlyChanging', () => {it.each([- { count: 3, expected: false },- { count: 4, expected: false },- { count: 5, expected: true },+ { count: 5, expected: false },+ { count: 6, expected: false },+ { count: 7, expected: true },{ count: 10, expected: true },])('flags a loop re-setting the same URL: $expected at $count changes', ({ count, expected }) => {for (let i = 0; i < count; i++) {diff --git a/frontend/src/lib/logic/scenes/urlChangeTracker.ts b/frontend/src/lib/logic/scenes/urlChangeTracker.tsindex 46f899ba4ed2..d30addb8333a 100644--- a/frontend/src/lib/logic/scenes/urlChangeTracker.ts+++ b/frontend/src/lib/logic/scenes/urlChangeTracker.ts@@ -60,7 +60,10 @@ interface UrlChangeTrackerConfig {}const DEFAULT_CONFIG: UrlChangeTrackerConfig = {- maxChangesPerSecond: 4,+ // A settling action<->URL round trip converges within a handful of writes, landing right around+ // 5-6 changes in the window. Keep the ceiling above that so ordinary sync churn isn't flagged;+ // only a burst that fails to converge (7+) looks like a genuine loop.+ maxChangesPerSecond: 6,windowMs: 3000,throttleWarningMs: 60000,// Above this many changes in the window we always treat the burst as a loop, even when every URL