Skip to content

fix(ffi): scope jid argument ownership - #377

Merged
Andiveli merged 3 commits into
betafrom
fix/ffi-jid-ownership
Aug 28, 2026
Merged

fix(ffi): scope jid argument ownership#377
Andiveli merged 3 commits into
betafrom
fix/ffi-jid-ownership

Conversation

@Andiveli

Copy link
Copy Markdown
Owner

Closes #374

Summary

  • keep Rust ownership of JID C strings across borrowed FFI calls
  • decode empty FFI contact results without constructing a slice from a null pointer
  • preserve the existing ABI

Changes

File Change
whatsrust/src/models.rs Add scoped ownership for C-compatible JIDs
whatsrust/src/queries.rs Use scoped arguments and guard empty results
whatsrust/src/message_send.rs Keep JID owners alive through outbound FFI calls

Test plan

  • cargo test --manifest-path whatsrust/Cargo.toml — 27 passed
  • Formatting and diff checks passed

Checklist

  • Linked approved issue
  • Conventional commit
  • No generated or unrelated changes

@Andiveli Andiveli added the type:bug Bug fix label Aug 28, 2026
@Andiveli
Andiveli merged commit b19e0b1 into beta Aug 28, 2026
1 check passed
@Andiveli
Andiveli deleted the fix/ffi-jid-ownership branch August 31, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant