René's URL Explorer Experiment


Title: fix(analytics): stop dropping client events captured before PostHog init by icecrasher321 · Pull Request #6988 · simstudioai/sim · GitHub

Open Graph Title: fix(analytics): stop dropping client events captured before PostHog init by icecrasher321 · Pull Request #6988 · simstudioai/sim

X Title: fix(analytics): stop dropping client events captured before PostHog init by icecrasher321 · Pull Request #6988 · simstudioai/sim

Description: Summary Two fixes to client-side exception logging, found while working out why captured crashes weren't diagnosable. Events captured before init were silently discarded. posthog.capture is a no-op until posthog.init() has run — its entire body sits behind if (this.__loaded) with no buffer and no warning. PostHogProvider reaches init through two dynamic imports (posthog-js and posthog-js/react) while a caller needs only one, so anything captured on mount resolved first and landed in that dead window: login_page_viewed, signup_page_viewed, landing_page_viewed, and — worst — a crash report from an error boundary that fired during first paint. The old typeof posthog.capture === 'function' guard could not catch this; the method exists from module load. Added a readiness gate that PostHogProvider settles on all three branches (enabled, disabled, load-failed), so pre-init events are held and flushed instead of dropped. Canvas crashes never reached Error Tracking. The workflow canvas error boundary reported them as a custom event with the message copied into a string property — no stack, no grouping, no issue, no session-replay link. It now also calls captureException, which parses the stack into $exception_list. The named event stays: it answers a different question ("how often does the canvas fall over") against a stable name that survives the error tracker's own grouping and resolution. Browser noise was drowning the real crashes. ResizeObserver loop completed with undelivered notifications was 92% of everything autocapture reported. It is specified behaviour rather than a fault — the observer defers the remaining notifications to the next frame — and it carries no stack that points anywhere useful. Alongside opaque cross-origin Script error. reports and cancellation signals (fetch AbortError, Monaco's CancellationError), it left a handful of genuine crashes unfindable. Filtered in before_send so these never leave the browser. The filter fails open on anything it does not recognize: it runs on every event, so a wrong guess would delete product analytics rather than merely over-report, and a chained exception is dropped only when every link is noise. Also dropped the now-unnecessary runtime import('posthog-js') from the capture helpers — they take the instance from the provider, so that module is type-only at runtime. Type of Change Bug fix Testing Added apps/sim/lib/posthog/client.test.ts (pre-init hold-and-flush, post-init path, captureException route, analytics-disabled path) and apps/sim/lib/posthog/exception-filter.test.ts (each filtered class, non-exception passthrough, chained exceptions, and the fail-open cases). bun run lint, bun run check:audits (32 audits), check-block-registry, and type-check all pass. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Two fixes to client-side exception logging, found while working out why captured crashes weren't diagnosable. Events captured before init were silently discarded. posthog.capture is a n...

X Description: Summary Two fixes to client-side exception logging, found while working out why captured crashes weren't diagnosable. Events captured before init were silently discarded. posthog.capture is...

Opengraph URL: https://github.com/simstudioai/sim/pull/6988

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e64ab112-8117-0906-f056-cc264e3622bf
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id909C:345450:9F7ED7:DC6224:6AFB5024
html-safe-nonce631ed92e2d5df552d30aeea07a41aa03dbb439b272eee6619f31e3c26d7dc2ab
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDlDOjM0NTQ1MDo5RjdFRDc6REM2MjI0OjZBRkI1MDI0IiwidmlzaXRvcl9pZCI6IjYwOTM5MTY5Njk2NTQ1MDU1MDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7345f02d9d34a66cd2add67a489b888f449e644ee3fa08908f0ff46397f0c50e
hovercard-subject-tagpull_request:4339975773
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6988/files
twitter:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
og:image:altSummary Two fixes to client-side exception logging, found while working out why captured crashes weren't diagnosable. Events captured before init were silently discarded. posthog.capture is a n...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6988/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6988%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6988%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6988/files
Reloadhttps://github.com/simstudioai/sim/pull/6988/files
Reloadhttps://github.com/simstudioai/sim/pull/6988/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
icecrasher321https://github.com/icecrasher321
staginghttps://github.com/simstudioai/sim/tree/staging
fix/posthog-client-exception-capturehttps://github.com/simstudioai/sim/tree/fix/posthog-client-exception-capture
Conversation 9 https://github.com/simstudioai/sim/pull/6988
Commits 4 https://github.com/simstudioai/sim/pull/6988/commits
Checks 30 https://github.com/simstudioai/sim/pull/6988/checks
Files changed https://github.com/simstudioai/sim/pull/6988/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6988/files
fix(analytics): stop dropping client events captured before PostHog init https://github.com/simstudioai/sim/pull/6988/files#top
Show all changes 4 commits https://github.com/simstudioai/sim/pull/6988/files
6e51d05 fix(analytics): stop dropping client events captured before PostHog init Aug 22, 2026 https://github.com/simstudioai/sim/pull/6988/commits/6e51d054a6dd15ccbe37f3a527502495ac3922d3
4a6cba5 fix(analytics): drop unactionable browser noise from error tracking Aug 22, 2026 https://github.com/simstudioai/sim/pull/6988/commits/4a6cba59dc1d4311c64a7e3657492545f2e51bd2
8419c6f fix(analytics): match cancellations on error name, not coerced type Aug 22, 2026 https://github.com/simstudioai/sim/pull/6988/commits/8419c6fbb7ed95b48f50328a2b93b9f804d4f781
0ba6c70 test(analytics): make posthog client tests order-independent Aug 22, 2026 https://github.com/simstudioai/sim/pull/6988/commits/0ba6c703b66ed3cdfe8196ad28d5b676e1637d94
Clear filters https://github.com/simstudioai/sim/pull/6988/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6988/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6988/files
posthog-provider.tsx https://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
index.tsx https://github.com/simstudioai/sim/pull/6988/files#diff-9c4e443a245b00d67a1e1b525e485b6d0f310f532f2606eb9fb262d32927f55d
client-disabled.test.ts https://github.com/simstudioai/sim/pull/6988/files#diff-93dc1e7a6325b14ab46558c300249f112263510fe29dee041aeec83cb239d1d3
client.test.ts https://github.com/simstudioai/sim/pull/6988/files#diff-25d9bd4d1c4c4d6bbdd2a0d30af789c86b0e3d56eedf7337678a8348a07f464d
client.ts https://github.com/simstudioai/sim/pull/6988/files#diff-0e4cc44e01449706e0aba9a85ea439f81e4380df023553ea31c30ef30643cbba
exception-filter.test.ts https://github.com/simstudioai/sim/pull/6988/files#diff-d1de1f999783a676c244f2899bbbc145aa2e4ca202a9791c6ebdc36b36fd5aa1
exception-filter.ts https://github.com/simstudioai/sim/pull/6988/files#diff-cbb1a5a937d8cf50f1df191eb43819509b158549e6a86de15ce231e95868f987
apps/sim/app/_shell/providers/posthog-provider.tsxhttps://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
View file https://github.com/simstudioai/sim/blob/0ba6c703b66ed3cdfe8196ad28d5b676e1637d94/apps/sim/app/_shell/providers/posthog-provider.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6988/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
https://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
https://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
https://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
https://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
https://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
https://github.com/simstudioai/sim/pull/6988/files#diff-840771c735d66bdc4a53ccbc3ff34b9324dc7dca2d7acbcf703dcc59832a4e48
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/error/index.tsxhttps://github.com/simstudioai/sim/pull/6988/files#diff-9c4e443a245b00d67a1e1b525e485b6d0f310f532f2606eb9fb262d32927f55d
View file https://github.com/simstudioai/sim/blob/0ba6c703b66ed3cdfe8196ad28d5b676e1637d94/apps/sim/app/workspace/%5BworkspaceId%5D/w/%5BworkflowId%5D/components/error/index.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6988/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6988/files#diff-9c4e443a245b00d67a1e1b525e485b6d0f310f532f2606eb9fb262d32927f55d
https://github.com/simstudioai/sim/pull/6988/files#diff-9c4e443a245b00d67a1e1b525e485b6d0f310f532f2606eb9fb262d32927f55d
https://github.com/simstudioai/sim/pull/6988/files#diff-9c4e443a245b00d67a1e1b525e485b6d0f310f532f2606eb9fb262d32927f55d
https://github.com/simstudioai/sim/pull/6988/files#diff-9c4e443a245b00d67a1e1b525e485b6d0f310f532f2606eb9fb262d32927f55d
https://github.com/simstudioai/sim/pull/6988/files#diff-9c4e443a245b00d67a1e1b525e485b6d0f310f532f2606eb9fb262d32927f55d
apps/sim/lib/posthog/client-disabled.test.tshttps://github.com/simstudioai/sim/pull/6988/files#diff-93dc1e7a6325b14ab46558c300249f112263510fe29dee041aeec83cb239d1d3
View file https://github.com/simstudioai/sim/blob/0ba6c703b66ed3cdfe8196ad28d5b676e1637d94/apps/sim/lib/posthog/client-disabled.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6988/{{ revealButtonHref }}
apps/sim/lib/posthog/client.test.tshttps://github.com/simstudioai/sim/pull/6988/files#diff-25d9bd4d1c4c4d6bbdd2a0d30af789c86b0e3d56eedf7337678a8348a07f464d
View file https://github.com/simstudioai/sim/blob/0ba6c703b66ed3cdfe8196ad28d5b676e1637d94/apps/sim/lib/posthog/client.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6988/{{ revealButtonHref }}
apps/sim/lib/posthog/client.tshttps://github.com/simstudioai/sim/pull/6988/files#diff-0e4cc44e01449706e0aba9a85ea439f81e4380df023553ea31c30ef30643cbba
View file https://github.com/simstudioai/sim/blob/0ba6c703b66ed3cdfe8196ad28d5b676e1637d94/apps/sim/lib/posthog/client.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6988/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6988/files#diff-0e4cc44e01449706e0aba9a85ea439f81e4380df023553ea31c30ef30643cbba
https://github.com/simstudioai/sim/pull/6988/files#diff-0e4cc44e01449706e0aba9a85ea439f81e4380df023553ea31c30ef30643cbba
Please reload this pagehttps://github.com/simstudioai/sim/pull/6988/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6988/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.