Skip to content

contacts check has no delegate through the follow socket, so it cannot run next to sync --follow (v0.18.2) #425

Description

@ceifa

Problem

wacli sync --follow holds the store lock for its whole lifetime, so wacli contacts check from another process always fails:

$ wacli contacts check <number> --json
{"success":false,"data":null,"error":"store is locked (another wacli is running?): store locked: resource temporarily unavailable (pid=601468 ...)"}

--lock-wait does not help. The follow process never releases the lock, so the wait always times out.

What already works

The send delegate socket (send_ipc.go) solves exactly this for 12 kinds: text, file, voice, sticker, react, location, poll, poll_vote, button_list_select, presence, edit and mark_read (#361, #380).

contacts check has the same shape. It is a live IsOnWhatsApp lookup: one query, one answer, no write to the local store. The invoking command validates and normalizes the numbers before the call and formats the result after it, like the delegated kinds do today.

Request

Add a delegated kind for contacts check, as #380 did for mark-read.

Use case

An agent keeps sync --follow running for live messages and webhooks, and shells out to wacli for actions. Sends, reactions and read state go through the delegate. Checking whether a number is registered on WhatsApp before writing to it is the one call left that forces stopping the sync unit and starting it again, which leaves the webhook dead for the length of the call.

The local mirror covers part of it: contacts search <number> answers for a number already synced, without touching the lock. A number the store has never seen still needs the live lookup, and that is the case where the check is worth making.

Tested on 0.18.2, Linux.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions