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.

chore(web-analytics): Properly decode path url (#71379)

Jordan Mryyane60cee8ffbd1
diff --git a/frontend/src/scenes/web-analytics/pageReportsLogic.test.ts b/frontend/src/scenes/web-analytics/pageReportsLogic.test.ts
index 9075ab5d8fef..cf573da457f8 100644
--- a/frontend/src/scenes/web-analytics/pageReportsLogic.test.ts
+++ b/frontend/src/scenes/web-analytics/pageReportsLogic.test.ts
@@ -135,6 +135,12 @@ describe('cleanPageURLForDisplay', () => {
filters: idRule,
expected: 'posthog.com/files/:id',
},
+ {
+ name: 'decodes an already-cleaned alias after URL parsing',
+ url: 'posthog.com/files/<id>',
+ filters: [{ regex: '\\d+', alias: '<id>' }],
+ expected: 'posthog.com/files/<id>',
+ },
{
name: 'applies rules in order',
url: 'posthog.com/files/123',
diff --git a/frontend/src/scenes/web-analytics/pageReportsLogic.ts b/frontend/src/scenes/web-analytics/pageReportsLogic.ts
index c83513bda82c..17e2f8d4bba7 100644
--- a/frontend/src/scenes/web-analytics/pageReportsLogic.ts
+++ b/frontend/src/scenes/web-analytics/pageReportsLogic.ts
@@ -145,7 +145,7 @@ export function cleanPageURLForDisplay(url: string, filters: PathCleaningFilter[
}
const parsed = parseWebAnalyticsURL(url)
if (parsed.isValid && parsed.pathname) {
- const cleanedPathname = cleanPathnameForDisplay(parsed.pathname, filters)
+ const cleanedPathname = cleanPathnameForDisplay(safeDecode(parsed.pathname), filters)
return parsed.host ? `${parsed.host}${cleanedPathname}` : cleanedPathname
}
return cleanPathnameForDisplay(url, filters)