Skip to content

chore(deps): migrate WhatsApp to wacore/whatsapp-rust 0.6#241

Merged
adolfousier merged 3 commits into
mainfrom
whatsapp-0.6
Jun 28, 2026
Merged

chore(deps): migrate WhatsApp to wacore/whatsapp-rust 0.6#241
adolfousier merged 3 commits into
mainfrom
whatsapp-0.6

Conversation

@adolfousier

Copy link
Copy Markdown
Owner

Closes #238.

Breaking migration of the WhatsApp integration from the 0.4.x to the 0.6.0 wacore / whatsapp-rust API. Draft for review/iteration.

Changes

  • Bump whatsapp-rust / wacore family 0.4.3 -> 0.6.0.
  • ProtocolStore rewrite: the old skdm-recipients and forget-sender-key methods are gone; added the new per-group device model (group_jid -> {device_jid -> has_key}) with 6 SQLite-backed methods (get_sender_key_devices, set_sender_key_status, clear_sender_key_devices, delete_sender_key_device_rows, clear_all_sender_key_devices, delete_devices) and a wa_sender_key_devices table.
  • Byte types: load_identity -> [u8;32], get_session / load_prekey -> bytes::Bytes.
  • Errors: upstream db_err removed, replaced by a local helper; serde sites use the boxed Serialization variant.
  • Events are now Arc<Event> (agent.rs).
  • Upload: Client::upload now takes UploadOptions; UploadResponse key fields are [u8;32] (handler.rs).
  • Inline store tests updated to the new model.

Verification

  • cargo build --lib: green
  • cargo test --locked --profile ci --all-features --lib -- whatsapp: 43 passed
  • cargo clippy --locked --lib --bins --tests --all-features -- -D warnings: clean
  • cargo audit --ignore RUSTSEC-2024-0437: 0 vulnerabilities

Follow-up

Bump the whatsapp-rust / wacore family 0.4.3 to 0.6.0 and port the
integration to the new API.

- ProtocolStore: drop the old skdm-recipients / forget-sender-key methods,
  add the new per-group device model (group -> {device -> has_key}) with 6
  SQLite-backed methods and a wa_sender_key_devices table.
- Byte types: load_identity returns [u8;32], get_session / load_prekey
  return bytes::Bytes.
- StoreError: db_err helper removed upstream, replaced with a local one;
  serde sites use the boxed Serialization variant.
- Events are now Arc<Event> (agent.rs).
- Client::upload now takes UploadOptions; UploadResponse key fields are
  [u8;32] (handler.rs).
- Inline store tests updated to the new sender-key-device model.

Gate: build, 43 whatsapp tests, clippy -D warnings, cargo audit all green.
… the worker stack (fixes #246)

The Event::Message arm awaited handle_message inline inside the on_event
future. The agent turn (send_message_with_tools_and_display) is a very
large async state machine; polling it nested in the event-loop future
overflowed the tokio worker's stack and aborted the process. Spawn the
handler onto its own task instead, matching the Connected arm's greeting.

This only surfaced once the owner filter (#245) let the owner's own
messages reach the agent path.
Brings the owner-auth/QR fixes (#242, #240, #245) and the inbound-handler
stack-overflow fix (#246) forward onto the wacore/whatsapp-rust 0.6 port,
which had diverged before any of them landed. Conflicts resolved in the
whatsapp module: keep the new fix logic, adapt to the 0.6 API (match on
&Event, Arc<Event> payloads).
@adolfousier adolfousier marked this pull request as ready for review June 28, 2026 19:11
@adolfousier adolfousier merged commit a696bf6 into main Jun 28, 2026
6 checks passed
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.

Bump wacore/whatsapp-rust 0.4.x to 0.6.0 (breaking API migration)

1 participant