Skip to content

fix(linux): register posthog-code scheme handler in AppImage builds#2628

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-appimage-oauth-scheme-handler
Draft

fix(linux): register posthog-code scheme handler in AppImage builds#2628
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-appimage-oauth-scheme-handler

Conversation

@posthog

@posthog posthog Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Problem

Users on Linux AppImage builds can't log in at all. The OAuth callback comes back via the posthog-code:// custom scheme, but the AppImage's generated .desktop file never declared the x-scheme-handler/posthog-code handler, so the OS couldn't route the callback to the app and login timed out — a complete login blocker for that segment. deb/rpm users were unaffected because those makers already declare the handler via sharedLinuxOptions.

Changes

  • Add mimeType: ["x-scheme-handler/posthog-code"] to the MakerAppImage options in apps/code/forge.config.ts so the generated .desktop file declares the scheme handler (matching the deb/rpm makers).
  • Document at the setAsDefaultProtocolClient call site that its path/args parameters are Windows-only and ignored on Linux — Linux registration relies on the packaged .desktop MimeType. This is a deliberate note: the originally-suspected part-2 fix (passing the AppImage exec path to setAsDefaultProtocolClient) is a no-op on Linux, so the packaging change is the actual remedy.

How did you test this?

  • pnpm --filter code typecheck — passes (confirms the AppImage maker accepts mimeType).
  • pnpm --filter code test deep-link — 129 passed.
  • pnpm exec biome lint on both changed files — clean.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code from an inbox report.

The MakerAppImage config omitted the `mimeType` option that the deb/rpm
makers get via `sharedLinuxOptions`, so the generated AppImage `.desktop`
file never declared `x-scheme-handler/posthog-code`. Without it, desktop
integration can't route the OAuth callback (`posthog-code://callback`)
back to the app and login times out, fully blocking AppImage users.

Add `mimeType: ["x-scheme-handler/posthog-code"]` to the AppImage maker so
the `.desktop` file declares the handler, matching deb/rpm.

Also document, where `setAsDefaultProtocolClient` is called, that its
`path`/`args` parameters are Windows-only and ignored on Linux — Linux
relies on the packaged `.desktop` MimeType — so a future change doesn't
try to "fix" AppImage routing by passing an exec path there (a no-op).

Generated-By: PostHog Code
Task-Id: f86f368b-dc7b-4da3-ba21-997a04b794ff
@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 4475a3c.

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(linux): register posthog-code scheme..." | Re-trigger Greptile

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.

0 participants