feat(desktop): capture os_platform and os_arch on analytics events - #83094
Merged
Conversation
|
😎 Merged successfully - details. |
Contributor
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
tatoalo
marked this pull request as ready for review
August 14, 2026 10:40
HostHog preview —
|
Contributor
Prompt To Fix All With AI### Issue 1
products/desktop/apps/code/src/renderer/contributions/app-boot.contributions.ts:32-37
**Promise-chain boot request**
The new host-info request uses `.then()` and `.catch()` instead of the repository-preferred async/await style, making initialization and error handling inconsistent with the project convention.
### Issue 2
products/desktop/packages/ui/src/shell/posthogAnalyticsImpl.ts:53-55
**Missing helper return type**
The new `hostInfoProperties` helper relies on an inferred return shape, contrary to the repository convention requiring explicit return types for frontend TypeScript functions.
```suggestion
function hostInfoProperties({
platform,
arch,
}: HostInfoProperties): Record<string, string> {
return { os_platform: platform, os_arch: arch };
}
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(desktop): capture os_platform and o..." | Re-trigger Greptile |
puemos
approved these changes
Aug 14, 2026
Electron's user agent reports "Intel Mac OS X" on every Mac, so $os cannot distinguish arm64 from x64 installs. Expose IAppMeta.platform/.arch through OsService and register them as super properties in the renderer, and add them to main-process captures. Generated-By: PostHog Desktop Task-Id: 91f0d0a8-d9e8-41d1-a096-942b34f72dcb
tatoalo
force-pushed
the
posthog/desktop-analytics-os-platform-arch
branch
from
August 14, 2026 10:55
631981d to
b72cd4b
Compare
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.
Problem
Electron's user agent reports
Intel Mac OS Xon every Mac, including Apple Silicon, so$oscollapses arm64 and x64 into one bucket. The only way to guess the arm/Intel mix today is release asset download counts, which is not ideal.Changes
OsService.getHostInfo()returns{ platform, arch }from the existingIAppMeta, exposed as theos.getHostInfotRPC query with a Zod output schema.os_platform/os_archas posthog-js super properties at boot, re-applied afterposthog.reset()alongsideapp_version.track/captureExceptionstamp the same two properties.