Skip to content

Filter Instagram webview bridge errors - #653

Draft
zacjones93 wants to merge 1 commit into
mainfrom
codex/filter-instagram-webview-posthog-error
Draft

Filter Instagram webview bridge errors#653
zacjones93 wants to merge 1 commit into
mainfrom
codex/filter-instagram-webview-posthog-error

Conversation

@zacjones93

@zacjones93 zacjones93 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a narrow PostHog before_send filter for the Instagram iOS webview bridge exception
  • preserve unrelated exceptions and all non-exception analytics events
  • add regression coverage and document the client error-filtering boundary in lat.md

Root cause

The reported PostHog issue was produced by Instagram's injected iOS webview lifecycle bridge, which assumes window.webkit.messageHandlers exists. Because the inline script inherits the current document URL, PostHog marked the frames as application code even though the bridge functions are absent from WODsmith source and the production page.

PostHog issue: https://us.posthog.com/error_tracking/019f1f7e-2399-7a02-8e8e-9c845fbe6d4b

Validation

  • pnpm --filter wodsmith-start exec vitest run test/lib/posthog-event-filter.test.ts
  • file-scoped Biome check
  • file-scoped TypeScript check
  • lat check
  • GitNexus staged change detection: LOW risk, 0 affected processes

Summary by cubic

Add a PostHog before_send filter to drop Instagram iOS webview bridge $exception events, reducing noise in error tracking. Real app errors and all other analytics remain intact.

  • Bug Fixes
    • Filters only $exception events containing window.webkit.messageHandlers.
    • Hooks before_send in the PostHog client via posthog-js.
    • Adds unit tests and documents the client-side error filtering boundary.

Written for commit 52c4478. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 40110846-08e3-4e81-a07d-14231a3cd08e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants