Skip to content

fix(replay): redirect saved filters from playlist routes - #71505

Merged
pauldambra merged 1 commit into
masterfrom
posthog-code/fix-replay-filter-playlist-redirect
Jul 16, 2026
Merged

fix(replay): redirect saved filters from playlist routes#71505
pauldambra merged 1 commit into
masterfrom
posthog-code/fix-replay-filter-playlist-redirect

Conversation

@posthog

@posthog posthog Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

Saved-filter playlists can be opened at /replay/playlists/:id, even though that scene is only valid for collection playlists. Loading a saved filter there also triggers playlist-only update behavior before the user reaches the recordings view.

Why: Saved filters should always open in the replay recordings view where their filters can be applied and edited.

Inbox report: https://us.posthog.com/project/2/inbox/019e18c7-1d63-7ace-bd34-17bf9d88bd57

Changes

  • Redirect type: 'filters' playlist loads to /replay/home?savedFilterId=:id before playlist-only side effects run.
  • Update the legacy navigation menu to generate the canonical saved-filter URL directly.
  • Add a logic regression test that verifies the redirect and prevents the playlist update action.

How did you test this code?

  • pnpm --filter=@posthog/frontend jest frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistSceneLogic.test.ts --runInBand
  • pnpm exec oxlint --quiet frontend/src/layout/navigation-3000/navigationLogic.tsx frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistSceneLogic.ts frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistSceneLogic.test.ts
  • git diff --check

The regression test catches filter-type playlists remaining on the collection playlist scene or firing the automatic playlist update during redirect.

Full frontend typecheck could not complete because this clean checkout is missing generated Kea *Type.ts files across unrelated frontend and product modules. hogli ci:preflight --fix could not run because the runner has no synced flox/uv Python environment.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

No documentation update is needed. This restores the existing saved-filter URL behavior.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

PostHog Code used the /inbox-exploration and /writing-tests skills. The Inbox report originally suggested loosening backend PATCH validation, but the requested product behavior is to treat filter playlists as invalid for the playlist scene. The implementation redirects old or bookmarked playlist URLs and fixes the remaining navigation source that generated them.

The GitHub App token could not resolve the directing user's GitHub identity, so the draft is left unassigned rather than assigning an unverified account.


Created with PostHog Code from an inbox report

Redirect filter-type playlist URLs to the canonical replay saved-filter URL and update the legacy navigation link to avoid generating invalid routes.

Generated-By: PostHog Code
Task-Id: 3ee3da14-5e17-4f04-baf2-69a3ce904551
@posthog posthog Bot added the skip-inkeep-docs Use this label to skip an Inkeep docs PR in posthog.com label Jul 16, 2026
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Bundle size — 🔺 +167 B (+0.0%)

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 64.79 MiB · 🔺 +167 B (+0.0%)

No file changed by more than 1000 B.

Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report

Eager graph — within budget

How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
1.22 MiB · 22 files no change ███░░░░░░░ 28.4% of 4.29 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
8.13 MiB · 2,981 files 🔺 +163 B (+0.0%) █████████░ 87.9% of 9.25 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
281.3 KiB ../node_modules/.pnpm/posthog-js@1.402.3/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
235.5 KiB src/taxonomy/core-filter-definitions-by-group.json
222.9 KiB ../node_modules/.pnpm/posthog-js@1.402.3/node_modules/posthog-js/dist/module.js
164.0 KiB src/queries/validators.js
154.3 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
105.8 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
92.7 KiB ../packages/quill/packages/quill/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

Dist folder size — 🔺 +2.4 KiB (+0.0%)

Total size of the built frontend/dist folder (all assets), compared against the base branch.

Total: 1312.84 MiB · 🔺 +2.4 KiB (+0.0%)

Playwright — all passed

All tests passed.

View test results →

@pauldambra
pauldambra marked this pull request as ready for review July 16, 2026 12:19
@pauldambra
pauldambra enabled auto-merge (squash) July 16, 2026 12:19
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested review from a team, TueHaulund, arnohillen, fasyy612 and ksvat and removed request for a team July 16, 2026 12:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05f98a3b73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

getPlaylistSuccess: ({ playlist }) => {
if (playlist?.type === 'filters') {
router.actions.replace(
combineUrl(urls.replay(ReplayTabs.Home), { savedFilterId: playlist.short_id }).url

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply saved filters after the redirect

For a bookmarked or in-app /replay/playlists/<saved-filter-id> route, this only replaces the URL with savedFilterId; the code that consumes that param is sessionRecordingSavedFiltersLogic.afterMount() and it runs only once. Since the navigation already mounts that logic to populate saved filters, the one-shot check has usually run before this redirect adds the param, so Replay home can render with default or stale filters even though the URL looks canonical. Make saved-filter application react to URL changes, or apply the loaded filter directly before/while redirecting.

Useful? React with 👍 / 👎.

@trunk-io

trunk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@pauldambra
pauldambra merged commit 72dfd03 into master Jul 16, 2026
334 of 387 checks passed
@pauldambra
pauldambra deleted the posthog-code/fix-replay-filter-playlist-redirect branch July 16, 2026 12:47
@posthog
posthog Bot restored the posthog-code/fix-replay-filter-playlist-redirect branch July 16, 2026 12:52
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-16 13:18 UTC Run
prod-us ✅ Deployed 2026-07-16 13:43 UTC Run
prod-eu ✅ Deployed 2026-07-16 13:40 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-inkeep-docs Use this label to skip an Inkeep docs PR in posthog.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant