mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 05:50:44 +08:00
Fix duplicate WhatsApp outbound delivery.
Claim pending rows atomically and serialize the sidecar poller so overlapping polls cannot send the same reply twice; also stop inbound queue delivery from falling through to a second enqueue. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
10ae4abc1d
commit
b6e023cd91
6 changed files with 193 additions and 14 deletions
|
|
@ -294,7 +294,11 @@ def create_app() -> FastAPI:
|
|||
|
||||
store = get_assistant_store()
|
||||
aid = str(account_id or os.getenv("AIA_WHATSAPP_ACCOUNT_ID") or "wa-default").strip()
|
||||
items = store.list_pending_channel_outbound_messages(channel="whatsapp", account_id=aid, limit=limit)
|
||||
claimer = getattr(store, "claim_pending_channel_outbound_messages", None)
|
||||
if callable(claimer):
|
||||
items = claimer(channel="whatsapp", account_id=aid, limit=limit)
|
||||
else:
|
||||
items = store.list_pending_channel_outbound_messages(channel="whatsapp", account_id=aid, limit=limit)
|
||||
return {"ok": True, "items": items}
|
||||
|
||||
@app.post("/whatsapp/outbound/ack")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue