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_session—record: &SessionRecord→record: SessionRecord(takes ownership)SenderKeyStore::store_sender_key—record: &SenderKeyRecord→record: SenderKeyRecord(takes ownership)
SignalStoreCache API
All methods now accept typed addresses instead of &str:
| Method | Before | After |
|---|---|---|
get_session
| &str → Option<Arc<[u8]>>
| &ProtocolAddress → Option<SessionRecord>
|
put_session
| &str, &[u8]
| &ProtocolAddress, SessionRecord
|
delete_session
| &str
| &ProtocolAddress
|
has_session
| &str
| &ProtocolAddress
|
get_sender_key
| &str → Option<Arc<[u8]>>
| &SenderKeyName → Option<SenderKeyRecord>
|
put_sender_key
| &str, &[u8]
| &SenderKeyName, SenderKeyRecord
|
Struct changes
ProtocolAddress— added privatedisplayfield; struct literal construction no longer works, useProtocolAddress::new()SenderKeyName— added privatecache_keyfield; struct literal construction no longer works, useSenderKeyName::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