Skip to content

bug: release history sync callback payload allocations #375

Description

@Andiveli

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

  1. Receive a history-sync conversation event.
  2. Dispatch the chat payload through the registered callback.
  3. 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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus:approvedIssue approved for implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions