Skip to content

fix: app crash if no writable stdout is available #9951#9984

Merged
godfrzero merged 5 commits into
developfrom
fix/linux-launch
Jun 3, 2026
Merged

fix: app crash if no writable stdout is available #9951#9984
godfrzero merged 5 commits into
developfrom
fix/linux-launch

Conversation

@godfrzero
Copy link
Copy Markdown
Contributor

@godfrzero godfrzero commented May 29, 2026

On Linux, launching Insomnia from a .desktop entry (or any context without a writable stdout) could crash the main process in two ways:

  1. Synchronous write failure — initializeLogging() was called after initElectronStorage(), meaning early log writes could throw before any EPIPE handler was in place. Reordering the calls ensures logging is initialized first.
  2. Async EPIPE — Even with the reorder, EPIPE can surface as an async error event on process.stdout after the write is dispatched (e.g. when the read end of the pipe is closed). Without a handler this becomes an uncaught exception that crashes the main process. A process.stdout.on('error', ...) handler now silently drops EPIPE and re-throws everything else.

Together these fixes make the app stable when launched without a writable stdout, which is the common case on Linux desktop environments.

I couldn't test these changes on a linux system, but I was able to recreate what looks like the same error on macOS by launching Insomnia from the command line:

# head -0 exits immediately, causing an EPIPE error when the app tries to write to stdout.
<path to build> | head -0

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

✅ Circular References Report

Generated at: 2026-06-03T15:04:42.256Z
Status: ✅ NO CHANGE

Summary

Metric Base (develop) PR Change
Total Circular References 10 10 0 (0.00%)
Click to view all circular references in PR (10)
insomnia-inso/src/db/models/types.ts -> insomnia-inso/src/db/types.ts
insomnia/src/network/network.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/collection.ts -> insomnia-scripting-environment/src/objects/response.ts
insomnia/src/network/network.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/insomnia.ts -> insomnia-scripting-environment/src/objects/interfaces.ts
insomnia/src/network/network.ts -> insomnia/src/common/render.ts
insomnia/src/plugins/index.ts -> insomnia/src/plugins/context/store.ts
insomnia/src/plugins/misc.ts -> insomnia/src/plugins/index.ts
insomnia/src/ui/components/settings/import-export.tsx -> insomnia/src/ui/components/modals/export-requests-modal.tsx
insomnia/src/ui/components/tabs/tab-list.tsx -> insomnia/src/ui/components/tabs/tab.tsx
insomnia/src/ui/components/templating/tag-editor-arg-sub-form.tsx -> insomnia/src/ui/components/templating/external-vault/external-vault-form.tsx
insomnia/src/ui/components/viewers/response-viewer.tsx -> insomnia/src/ui/components/viewers/response-multipart-viewer.tsx
Click to view all circular references in base branch (10)
insomnia-inso/src/db/models/types.ts -> insomnia-inso/src/db/types.ts
insomnia/src/network/network.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/collection.ts -> insomnia-scripting-environment/src/objects/response.ts
insomnia/src/network/network.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/insomnia.ts -> insomnia-scripting-environment/src/objects/interfaces.ts
insomnia/src/network/network.ts -> insomnia/src/common/render.ts
insomnia/src/plugins/index.ts -> insomnia/src/plugins/context/store.ts
insomnia/src/plugins/misc.ts -> insomnia/src/plugins/index.ts
insomnia/src/ui/components/settings/import-export.tsx -> insomnia/src/ui/components/modals/export-requests-modal.tsx
insomnia/src/ui/components/tabs/tab-list.tsx -> insomnia/src/ui/components/tabs/tab.tsx
insomnia/src/ui/components/templating/tag-editor-arg-sub-form.tsx -> insomnia/src/ui/components/templating/external-vault/external-vault-form.tsx
insomnia/src/ui/components/viewers/response-viewer.tsx -> insomnia/src/ui/components/viewers/response-multipart-viewer.tsx

Analysis

No Change: This PR does not introduce or remove any circular references.


This report was generated automatically by comparing against the develop branch.

@godfrzero godfrzero marked this pull request as ready for review June 3, 2026 01:12
Copy link
Copy Markdown
Contributor

@notjaywu notjaywu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@godfrzero godfrzero merged commit 8b5caa0 into develop Jun 3, 2026
44 of 49 checks passed
@godfrzero godfrzero deleted the fix/linux-launch branch June 3, 2026 17:39
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.

3 participants