Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 22 Mar 14:39
· 454 commits to main since this release

Breaking Changes

Why these changes? These breaking changes eliminate per-message serialization, deserialization, and heap allocations from the Signal protocol encrypt/decrypt hot path — matching WhatsApp Web's architecture where session and sender key objects are cached in memory and only serialized during periodic flush to storage. In benchmarks, this reduces ~70% of the CPU cost that was previously spent on protobuf encode/decode and unnecessary cloning on every message.

Trait signature changes

Downstream implementations of these traits must update:

  • SessionStore::store_sessionrecord: &SessionRecordrecord: SessionRecord (takes ownership)
  • SenderKeyStore::store_sender_keyrecord: &SenderKeyRecordrecord: SenderKeyRecord (takes ownership)

SignalStoreCache API

All methods now accept typed addresses instead of &str:

Method Before After
get_session &strOption<Arc<[u8]>> &ProtocolAddressOption<SessionRecord>
put_session &str, &[u8] &ProtocolAddress, SessionRecord
delete_session &str &ProtocolAddress
has_session &str &ProtocolAddress
get_sender_key &strOption<Arc<[u8]>> &SenderKeyNameOption<SenderKeyRecord>
put_sender_key &str, &[u8] &SenderKeyName, SenderKeyRecord

Struct changes

  • ProtocolAddress — added private display field; struct literal construction no longer works, use ProtocolAddress::new()
  • SenderKeyName — added private cache_key field; struct literal construction no longer works, use SenderKeyName::new()

What's Changed

  • fix: persist Device.account through serde by @jlucaso1 in #414
  • perf: typed cache API + sender key object cache by @jlucaso1 in #415
  • feat: MediaEncryptor streaming API + PortableCache fixes by @jlucaso1 in #416

Full Changelog: v0.4.3...v0.5.0