message_count property on threads has the total count of bulk-message-deletes twice subtracted from the current message count, offsetting the message_count accuracy by however many messages were deleted. This problem only shows itself with the rest API, and is not present when using the gateway, meaning that locally tracking the state is accurate to the gateway, but wildly off when fetching the thread with the rest API.
Steps to Reproduce
- Create a new thread
- Send some messages, at least 6 or more.
- Bulk delete 2 or more messages, but not more than half of the messages, (eg if you sent 9, delete a max of 4, but recommended to delete 2 or 3)
- fetch the thread with the http api, and inspect the thread’s message_count property
- connect to the gateway and see the thread’s message_count property is accurate and did not doubly subtract the results.
The http api matches the gateway for how many messages currently exist in the thread.
The HTTP API has subtracted the deleted messages twice from its counter, so if 4 messages were deleted in bulk, the counter is 4 less than what it should be.
Client and System Information
Read more here: Source link