Session recording do not work with hashed assets
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 7h 27m
- Merged PRs (30d)
- 222
Description
Bug description
According to docs, most of the time the session recording feature will fetch assets (fonts, js, images, css, etc.) inline - when the recording is captured.
But for some assets, it will only access the resource in "real-time" - when rendering a recording.
If a "hashed asset" (e.g. https://example.com/assets/vendor-cd39faaa.js) has been rebuilt in the timeframe between the recording capture to its rendering, the asset won't load when rendering the recording.
How to reproduce
- Create an empty vite app (or any other bundler that uses hashed assets).
- Install the react posthog snippet in the app.
- Deploy the app on Netlify (for example, any other service that uses atomic deploys will do).
- Record a session.
- Rebuild and re-deploy the app, the URLs of the hashed assets are now changed.
- Replay the session from step
4, you'll notice that some requests (e.g.,vendor-XXXXXXXX.jswill point to 404 URLs.
Environment
- PostHog Cloud US, project ID: 34026
- PostHog Cloud EU, project ID: None
- PostHog Hobby self-hosted with
docker compose, version/commit: None - PostHog self-hosted with Kubernetes (deprecated, see "Sunsetting Kubernetes support"), version/commit: None
Additional context
This can be solved by downloading the non-inline assets in the background like fullstory does in a short timeframe after the capture.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with an empty Vite app using the React PostHog snippet, then capture and replay a session across two atomic deployments. Trace the session recording asset loading behavior described in the report; done means hashed assets from the original recording no longer produce 404 requests during replay.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, vite
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100