Skip to content

fix: remove hard-deleted thread replies shown in the channel from the message list - #1892

Open
RaphaelFakhri wants to merge 1 commit into
GetStream:masterfrom
RaphaelFakhri:fix/remove-hard-deleted-reply-shown-in-channel
Open

RaphaelFakhri wants to merge 1 commit into
GetStream:masterfrom
RaphaelFakhri:fix/remove-hard-deleted-reply-shown-in-channel

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Title: fix: remove hard-deleted thread replies shown in the channel from the message list

CLA

  • I have signed the Stream CLA (required).
  • Code changes are tested

Description of the changes, What, Why and How?

ChannelState.removeMessage removes a thread reply from threads[parent_id] and skips the channel message sets (if / else). A reply sent with show_in_channel: true exists in both places, so a message.deleted event with hard_delete removed it from the thread only and left it in channel.state.messages.

removeMessage now also removes the message from the channel message sets when show_in_channel is true, or when the thread is not loaded (the previous behavior). The show_in_channel field is read from the message passed by the message.deleted handler.

A test in channel_state.test.js hard-deletes a reply that is shown in the channel and checks both lists. The test fails on the previous code and passes with this change. channel_state.test.js and channel.test.js pass (235 tests).

Changelog

  • Fix hard-deleted thread replies with show_in_channel staying in the channel message list.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant