Skip to content

refactor(whatsrust): extract read synchronization wrappers - #317

Merged
Andiveli merged 1 commit into
betafrom
refactor/whatsrust-read-sync
Aug 27, 2026
Merged

refactor(whatsrust): extract read synchronization wrappers#317
Andiveli merged 1 commit into
betafrom
refactor/whatsrust-read-sync

Conversation

@Andiveli

Copy link
Copy Markdown
Owner

Summary

  • Move mark_as_read and sync_chat_read into read_sync.rs.
  • Preserve the public API, FFI ownership, error mapping, and asynchronous behavior.

Changes

  • Added the crate-private read_sync module with explicit public facade reexports.
  • Moved the borrowed CString regression test with its owning implementation.
  • Kept the existing event-test visibility wiring compiling after the prior extraction chain.

Chain Context

Testing

  • CARGO_TARGET_DIR=/home/samael/Escritorio/Programacion/public/wptui-public/target cargo check --workspace --all-targets
  • CARGO_TARGET_DIR=/home/samael/Escritorio/Programacion/public/wptui-public/target cargo test -p whatsrust borrowed_ffi_arguments_can_be_reused_without_owned_pointer_leaks -- --test-threads=1
  • CARGO_TARGET_DIR=/home/samael/Escritorio/Programacion/public/wptui-public/target cargo test --test whatsrust_api_contract -- --test-threads=1
  • cargo fmt --all -- --check
  • git diff --check
  • Manual runtime testing: not applicable; this is a behavior-preserving FFI extraction.

Review Budget and Rollback

  • Authored diff: 277 lines (150 additions + 127 deletions), within the 400-line limit.
  • Rollback: revert a65bb20; removes read_sync.rs and restores the wrapper block without changing bridge behavior.

Out of scope

  • No ABI, threading, error-policy, cache, leak, or panic behavior changes.
  • No merge or CI wait.

Closes #316

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

Labels

type:refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant