Problem
History-sync chat callback payloads allocate a C ChatEvent and chat JID string without releasing them after synchronous callback delivery.
Reproduction or motivating example
- Receive a history-sync conversation event.
- Dispatch the chat payload through the registered callback.
- Observe that the callback payload allocations have no cleanup after delivery.
Expected behavior
The callback may read the payload synchronously, after which both the nested chat string and outer event allocation are released exactly once.
Actual behavior
The allocations remain unreleased after callback delivery.
Relevant evidence
Affected code is in whatsrust/lib/sync_events.go.
Acceptance criteria
- Cleanup occurs only after the synchronous callback returns.
- Nested and outer allocations are each released exactly once.
- Tests verify callback and cleanup ordering.
- Full Go tests pass.
Problem
History-sync chat callback payloads allocate a C
ChatEventand chat JID string without releasing them after synchronous callback delivery.Reproduction or motivating example
Expected behavior
The callback may read the payload synchronously, after which both the nested chat string and outer event allocation are released exactly once.
Actual behavior
The allocations remain unreleased after callback delivery.
Relevant evidence
Affected code is in
whatsrust/lib/sync_events.go.Acceptance criteria