zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Handle edit message events triggering change in mention flags and unreads.

Open zee-bit opened this issue 3 years ago • 0 comments

The commit structure is as follows:

  • helper/model: Copy unread mentioned messages from initial_data to Index.: Creates a new field in index as unread_mentioned_msg_ids which stores the message ids of unread mentioned messages obtained from the initial_data.

  • bugfix: api_types/model: Update mention flags on message edit events.: This commit updates the index, unread_count and flags if the message was indexed when an update message event with change in mention flag(s) is detected. If the message was not in index, we just update the unread_count. The count is updated after checking with initial data's unread mentioned msgs field which does not stay synced with the server, hence the logic is buggy.

  • model: Update index's "unread_mentioned_msg_ids" field from events.: This commit updates the index.unread_mentioned_msg_ids field through update_message and update_message_flag events.

  • tests: model: Extend other tests to incorporate both mentioned flags.: This commit expands some of the fixtures of present tests with the mentioned/wildcard_mentioned flags to make the tests more robust and generalized.

zee-bit avatar Jul 05 '21 23:07 zee-bit