chore(deps): migrate WhatsApp to wacore/whatsapp-rust 0.6#241
Merged
Conversation
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).
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.
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
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 awa_sender_key_devicestable.load_identity->[u8;32],get_session/load_prekey->bytes::Bytes.db_errremoved, replaced by a local helper; serde sites use the boxedSerializationvariant.Arc<Event>(agent.rs).Client::uploadnow takesUploadOptions;UploadResponsekey fields are[u8;32](handler.rs).Verification
cargo build --lib: greencargo test --locked --profile ci --all-features --lib -- whatsapp: 43 passedcargo clippy --locked --lib --bins --tests --all-features -- -D warnings: cleancargo audit --ignore RUSTSEC-2024-0437: 0 vulnerabilitiesFollow-up
Bytesis imported viaaxum::body::Bytes(re-export) sincebytesis not a direct dep. Could promotebytesto a direct optional dep for clarity.