You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When one of users deletes thread message it does not disappear for other users. It only happens when parameter hard: is set to true.
Steps to reproduce
1. Open same thread on least 2 devices
2. One of users creates message
3. Same user needs to delete message
4. It will not disappear for other user
Supporting info to reproduce
Here is code that you can reproduce this bug with.
This is modified example from core repo with following logic when building message.
Shows message text and type,
When taping message it opens thread for it.
When long pressing message you can hard delete message.
final item = messages[index];
final client =StreamChatCore.of(context).client;
final isCurrentUserMessage = item.user!.id == client.uid;
final alignment = isCurrentUserMessage
?Alignment.centerRight
:Alignment.centerLeft;
final canOpenThread = widget.parentMessage ==null;
final text ='${item.text!} -> type ${item.type}';
returnGestureDetector(
onTap: canOpenThread
? () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
returnStreamChannel(
channel: channel,
child:MessageScreen(
parentMessage: item,
),
);
},
),
);
}
:null,
onLongPress: isCurrentUserMessage
? () async {
finaldynamic result =awaitshowDialog<bool>(
context: context,
builder: (_) =>constDeleteConfirmationDialog(),
);
if (result ==true) {
await channel.deleteMessage(item, hard:true);
}
}
:null,
child:Align(
alignment: alignment,
child:MessageWidget(text: text),
),
);
Here is short video showing bug.
hard_delete_thread_message.mov
I was able to narrow down to implementation of ChannelClientState.removeMessage. Basically type of message is different and that's why its not removed.
threads[parentId]!..remove(message)
Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Which packages are you using?
stream_chat_flutter_core
On what platforms did you experience the issue?
iOS, Android
What version are you using?
stream_chat_flutter_core: ^3.3.1
What happened?
When one of users deletes thread message it does not disappear for other users. It only happens when parameter
hard:
is set to true.Steps to reproduce
1. Open same thread on least 2 devices 2. One of users creates message 3. Same user needs to delete message 4. It will not disappear for other user
Supporting info to reproduce
Here is code that you can reproduce this bug with.
This is modified example from core repo with following logic when building message.
Here is short video showing bug.
hard_delete_thread_message.mov
I was able to narrow down to implementation of
ChannelClientState.removeMessage
. Basically type of message is different and that's why its not removed.threads[parentId]!..remove(message)
Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: