fix: upgrade posthog-node to v5 to fix missing telemetry events#28
Merged
AmanVarshney01 merged 1 commit intomainfrom Mar 17, 2026
Merged
fix: upgrade posthog-node to v5 to fix missing telemetry events#28AmanVarshney01 merged 1 commit intomainfrom
AmanVarshney01 merged 1 commit intomainfrom
Conversation
…HTTP request posthog-node v4's `captureImmediate` had a bug where the `.then()` chain didn't return the promise from `captureStatelessImmediate`, causing the HTTP request to be fire-and-forget. Combined with trpc-cli calling `process.exit()` after the handler completes, telemetry events were silently dropped before the request could finish. This upgrades posthog-node from 4.18.0 to 5.28.2 where the bug is fixed, and removes the deprecated `captureMode` and `persistence` options that no longer exist in v5.
|
Caution Review failedPull request was closed or merged during review WalkthroughUpdated posthog-node dependency from version 4.18.0 to ^5.28.2 (major version). Refactored telemetry client to compute anonymousId and sanitizedProperties once rather than repeatedly, and removed explicit captureMode and persistence configuration settings. Changes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
PR preview published
|
aidankmcalister
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
posthog-nodefrom4.18.0to5.28.2to fix a bug wherecaptureImmediatedidn't properly await the HTTP request, causing telemetry events to be silently dropped beforeprocess.exit()captureModeandpersistenceconstructor options that no longer exist in v5Root cause
In posthog-node v4,
captureImmediate()had a missingreturnin a.then()chain, so the promise resolved before the HTTP request completed. Sincetrpc-clicallsprocess.exit()after the handler finishes, the in-flight request was killed. This is fixed in v5.Summary by CodeRabbit
Release Notes