[PR #275] [MERGED] Fix IPC socket on Mac/Linux, improve startup/exit flow #205

Closed
opened 2026-10-02 22:11:31 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/appy-one/acebase/pull/275
Author: @appy-one
Created: 6/8/2026
Status: ✅ Merged
Merged: 6/8/2026
Merged by: @appy-one

Base: master ← Head: fix/linux-mac-socket-ipc


📝 Commits (6)

  • 28030e8 use temp db path from settings
  • 26e6b7f Fix IPC socket on Mac/Linux, improve startup/exit flow
  • 747b91d Enable socket IPC mode for tests
  • cc4de5e New browser build
  • 0ee522e Win32: change named pipe to use a similar name as a unix socket
  • db86399 new browser build

📊 Changes

8 files changed (+11731 additions, -11700 deletions)

View changed files

📝 dist/browser.js (+11300 -11300)
📝 dist/browser.min.js (+1 -1)
📝 src/ipc/ipc.ts (+2 -2)
📝 src/ipc/service/index.ts (+142 -113)
📝 src/ipc/service/shared.ts (+10 -11)
📝 src/ipc/socket.ts (+272 -269)
📝 src/test/readonly.spec.ts (+2 -2)
📝 src/test/tempdb.ts (+2 -2)

📄 Description

Summary

  • Fixes IPC socket startup/exit flow on Mac/Linux (stale socket file handling, EADDRINUSE race condition)
  • Win32: renames the named pipe to match the Unix socket naming convention
  • Enables socket IPC mode in tests
  • Updates temp DB path to use path from settings

Changes

Cherry-picks the socket IPC fixes from improvements/20260519 #274, excluding the
unrelated file-extension/ESM module resolution changes.

src/ipc/service/index.ts

  • Pre-checks the socket path before listening to detect a running server or stale
    socket file (common on macOS where socket files persist after process exit)
  • Cleans up the socket file on server close
  • Handles EADDRINUSE race condition with a test-connect to confirm another process
    truly holds the socket

src/ipc/socket.ts

  • Startup retry logic (100 attempts with 100ms backoff) instead of failing immediately
  • Cleaner exit handling: socket is destroyed on IPC peer exit
  • EventEmitterLike updated to support both on/off and addListener/removeListener styles

Win32

  • Named pipe now uses a path-like name consistent with the Unix socket convention

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/appy-one/acebase/pull/275 **Author:** [@appy-one](https://github.com/appy-one) **Created:** 6/8/2026 **Status:** ✅ Merged **Merged:** 6/8/2026 **Merged by:** [@appy-one](https://github.com/appy-one) **Base:** `master` ← **Head:** `fix/linux-mac-socket-ipc` --- ### 📝 Commits (6) - [`28030e8`](https://github.com/appy-one/acebase/commit/28030e8f216417f5f01acfd0a540d9a2e210e41f) use temp db path from settings - [`26e6b7f`](https://github.com/appy-one/acebase/commit/26e6b7fdea2520370018ae7fc61b584a890efa64) Fix IPC socket on Mac/Linux, improve startup/exit flow - [`747b91d`](https://github.com/appy-one/acebase/commit/747b91d6ec37bea61a73dd68d2abccb4d358b6f9) Enable socket IPC mode for tests - [`cc4de5e`](https://github.com/appy-one/acebase/commit/cc4de5e8bccabc687680d6c8808b54ff2b9e3b06) New browser build - [`0ee522e`](https://github.com/appy-one/acebase/commit/0ee522e5cc7f6b7e31ec6826720841fb300545b1) Win32: change named pipe to use a similar name as a unix socket - [`db86399`](https://github.com/appy-one/acebase/commit/db8639914c4e739821d1e77a8ea3a9d58df61a8d) new browser build ### 📊 Changes **8 files changed** (+11731 additions, -11700 deletions) <details> <summary>View changed files</summary> 📝 `dist/browser.js` (+11300 -11300) 📝 `dist/browser.min.js` (+1 -1) 📝 `src/ipc/ipc.ts` (+2 -2) 📝 `src/ipc/service/index.ts` (+142 -113) 📝 `src/ipc/service/shared.ts` (+10 -11) 📝 `src/ipc/socket.ts` (+272 -269) 📝 `src/test/readonly.spec.ts` (+2 -2) 📝 `src/test/tempdb.ts` (+2 -2) </details> ### 📄 Description ## Summary - Fixes IPC socket startup/exit flow on Mac/Linux (stale socket file handling, EADDRINUSE race condition) - Win32: renames the named pipe to match the Unix socket naming convention - Enables socket IPC mode in tests - Updates temp DB path to use path from settings ## Changes Cherry-picks the socket IPC fixes from `improvements/20260519` #274, excluding the unrelated file-extension/ESM module resolution changes. ### src/ipc/service/index.ts - Pre-checks the socket path before listening to detect a running server or stale socket file (common on macOS where socket files persist after process exit) - Cleans up the socket file on server close - Handles EADDRINUSE race condition with a test-connect to confirm another process truly holds the socket ### src/ipc/socket.ts - Startup retry logic (100 attempts with 100ms backoff) instead of failing immediately - Cleaner exit handling: socket is destroyed on IPC peer exit - EventEmitterLike updated to support both on/off and addListener/removeListener styles ### Win32 - Named pipe now uses a path-like name consistent with the Unix socket convention --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-10-02 22:11:31 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github-starred/acebase#205
No description provided.