feat: Unix socket IPC for send while sync is running#65
Open
vlassance wants to merge 1 commit intosteipete:mainfrom
Open
feat: Unix socket IPC for send while sync is running#65vlassance wants to merge 1 commit intosteipete:mainfrom
vlassance wants to merge 1 commit intosteipete:mainfrom
Conversation
When sync --follow is running, start a Unix socket server at <store>/send.sock that accepts JSON send requests. Both send text and send file commands try the socket first before falling back to a direct connection. Supports text messages and file uploads (image/video/audio/document) with MIME detection. Closes steipete#6 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 19, 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
<store>/send.sockwhensync --followis runningsend textandsend filetry the socket first, falling back to direct connectionProblem
wacli sendcannot work whilesync --followis running because both commands need the store. This makes it impossible to send messages programmatically while maintaining a sync session (see #6).Solution
sync --follownow starts a Unix socket server that accepts send requests from other wacli processes. Thesendcommands check for the socket first and route through the running sync daemon, falling back to a direct connection if sync is not running.How it works
sync --followstarts a socket server at~/.wacli/send.socksend text/send filecheck if the socket exists and try IPC firstProtocol
Each request/response is a single JSON line terminated by
\n:{"to": "+1234567890", "message": "hello"} {"to": "+1234567890", "type": "file", "file_path": "/tmp/photo.jpg", "caption": "check this out"}Testing
go test ./...— all tests passgo build ./...— builds cleanlyCloses #6