Repository navigation
Conversation
ac69283 to
6778f87
Compare
d03bb76 to
2e12f47
Compare
6778f87 to
c01dd83
Compare
2e12f47 to
8e98f94
Compare
8e98f94 to
d012458
Compare
2fa7725 to
c01dd83
Compare
d012458 to
8e98f94
Compare
c01dd83 to
86f3699
Compare
bc7d27f to
70f292b
Compare
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
165e13b2-9387-4a01-912d-6c7d03cf9f5d
Files selected for processing: 15-
src/main/startup/main-process-observers-hang-breadcrumb.test.tssrc/main/startup/main-process-observers.tssrc/main/telemetry/capture-queue-limit.tssrc/main/telemetry/client-agent-dashboard-active.test.tssrc/main/telemetry/client-lifecycle.test.tssrc/main/telemetry/client-onboarding-language-cohort.test.tssrc/main/telemetry/client-opt-out-shutdown.test.tssrc/main/telemetry/client-sdk-delivery.test.tssrc/main/telemetry/client-transport-startup.test.tssrc/main/telemetry/client.tssrc/main/telemetry/consent.tssrc/main/telemetry/deferred-transport.tssrc/main/telemetry/posthog-transport.tssrc/main/telemetry/session-properties.tssrc/main/usage/usage-provider-store-lifecycle.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
ELI5
Disabled and unofficial sessions skip loading PostHog. Enabled sessions keep consent/event validation synchronous and load one SDK owner through the existing first-window deferral. Queued events retain their original capture times. This PR is standalone against main.
What Changed
Use one retryable transport import and recheck live build/consent before construction and capture. Deferred capacity shares the SDK’s 5,000-event limit; the existing 1,000-event session cap remains tighter. Explicit opt-out saves false and discards ordinary pending events immediately, while preserving the existing admitted opt-out control event.
Shutdown closes admission and joins accepted work within the existing two-second caller budget. A constructed SDK receives shutdown exactly once, including shutdown(0) when accepted work consumes the allowance, so its flush timer is retired. Late imports cannot construct an owner after retirement. No protocol, settings schema, new process or shutdown call site is introduced.
Final head
65e22a1f6d59ad3927c75960ed38b86de24ad11cis based on main77130982faf. The consent entrypoints catch/log an SDK startup failure and still admit their bounded events for later retry; direct transport startup keeps its rejection contract. This fixes a reproduced new failure where consent persisted but app_opened/opt-in events were lost even after retry. The final commit also preserves main’s deletion of an adapted low-value cohort test, resolving its modify/delete conflict without restoring it.Measurements
Nine alternating samples per ref/scenario in fresh Linux Node26.8.1 processes compare final65e22 against exact main77130982 through the bundled production telemetry seam with the actual installed SDK and intercepted HTTP. User-disabled and environment-disabled sessions avoid 95 SDK modules and about 4.35 MiB retained heap; unofficial sessions avoid about 2.53 MiB. These are isolated subsystem measurements, not whole-app PSS or app startup/paint measurements.
Enabled demand loads the same 95 modules and converges to the parent footprint. Its final65 isolated demand median is65.3 ms versus2.7 ms with the parent already initialized: loading is deferred, not moved off the main thread. No enabled steady-state memory saving is claimed.
Validation
ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2passed all 19 checks in830.4s. Final PR CI40430982152 and headless CI40430982048 passed; all17 non-skipped hosted checks are green. GitHub reports mergeable/clean, with no unresolved review thread. No baseline waiver or earlier-head result substitutes for this final gate.Tradeoffs and limits
SDK evaluation remains on Electron main. The two-second caller budget is cooperative and cannot preempt synchronous JavaScript. Public SDK shutdown(0) may start best-effort I/O after the caller budget; it clears the flush timer but does not hard-cancel already issued SDK HTTP. Slow import, endpoint failure or deadline exhaustion can lose best-effort events. The existing overlapping off→on issue also reproduces on main and remains outside this loading change.
Native signed installation, production-endpoint delivery and live remote/mobile producers are not newly executed by the Linux controls. The historical combined-stack percentage is not a measurement of this standalone implementation. Benchmark scripts and reports remain external validation artifacts; #33912 has been reverted in #34162.
Visual Proof
Final65 hidden Playwright CLI/CDP run on isolated Linux Xvfb uses a synthetic official identity/dummy key and intercepts actual installed-SDK HTTP. It clicks the banner Opt out and Privacy on/off/on controls, verifying saved consent, rendered switch states and exact emitted batches. Both screenshots were directly inspected. The fixture launches with DNT to install interception, then clears DNT only in its owned main process; diagnostic availability is latched at startup, so its separate diagnostic-file warning remains visible. This is disclosed fixture setup, not a normal user DNT transition or production-endpoint proof.
Agent skill upstream boundary