Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: endless capturing /s/ #1551

Merged
merged 5 commits into from
Nov 26, 2024
Merged

fix: endless capturing /s/ #1551

merged 5 commits into from
Nov 26, 2024

Conversation

pauldambra
Copy link
Member

We check for /s/, /e/, and /i/ in URL's pathname and don't capture network payloads to them

But if you use a reverse proxy then the pathname won't necessarily be /s/ e.g. some folk use /ingest/s/ so we need a slightly different check

Otherwise when you visit one of these sites we endlessly send a network payload to ourselves recording that we just sent a network payload to ourselves etc

Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Nov 26, 2024 8:50am

@pauldambra pauldambra added the bump patch Bump patch version when this PR gets merged label Nov 25, 2024
@pauldambra pauldambra requested a review from a team November 25, 2024 22:55
Copy link

github-actions bot commented Nov 25, 2024

Size Change: +1.38 kB (+0.04%)

Total Size: 3.14 MB

Filename Size Change
dist/array.full.es5.js 255 kB +136 B (+0.05%)
dist/array.full.js 358 kB +138 B (+0.04%)
dist/array.full.no-external.js 357 kB +138 B (+0.04%)
dist/array.js 172 kB +138 B (+0.08%)
dist/array.no-external.js 171 kB +138 B (+0.08%)
dist/main.js 173 kB +138 B (+0.08%)
dist/module.full.js 358 kB +138 B (+0.04%)
dist/module.full.no-external.js 357 kB +138 B (+0.04%)
dist/module.js 173 kB +138 B (+0.08%)
dist/module.no-external.js 171 kB +138 B (+0.08%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 206 kB
dist/dead-clicks-autocapture.js 14.3 kB
dist/exception-autocapture.js 9.37 kB
dist/external-scripts-loader.js 2.29 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 57.6 kB
dist/surveys.js 63.2 kB
dist/tracing-headers.js 1.75 kB
dist/web-vitals.js 10.3 kB

compressed-size-action

@pauldambra pauldambra removed the bump patch Bump patch version when this PR gets merged label Nov 26, 2024
@pauldambra pauldambra merged commit d49244f into main Nov 26, 2024
13 checks passed
@pauldambra pauldambra deleted the fix/endlessly-capturing branch November 26, 2024 09:27
const ignorePostHogPaths = (data: CapturedNetworkRequest): CapturedNetworkRequest | undefined => {
const ignorePostHogPaths = (
data: CapturedNetworkRequest,
apiHostConfig: PostHogConfig['api_host']
Copy link
Member

Choose a reason for hiding this comment

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

do we need to filter from ui_host as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so... I think it's just the possible endless loop of capturing our own api calls with our own api calls 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants