stream-chat-swift
stream-chat-swift copied to clipboard
Messages are disappeared after pin/unpin message
What did you do?
Pin/Unpin message
What did you expect to happen?
Message should be mark as pin
What happened instead?
Pinned messages are disappeared from message list
GetStream Environment
GetStream Chat version: 4.15 GetStream iOS version: 15.2 Swift version: 5 Xcode version: 13.2 Device: Simulator
https://user-images.githubusercontent.com/97155807/174289797-f091c8cc-a533-40e6-bc65-30235791df8f.mov
Additional context
open func pinMessage(message: ChatMessage, completion: ((Error?) -> Void)? = nil) { guard let cid = dataSource?.channel(for: self)?.cid else { log.error("Channel is not available"); return } let messageController = client.messageController( cid: cid, messageId: message.id ) if message.isPinned { messageController.unpin { error in completion?(error) } } else { messageController.pin(MessagePinning.noExpiration, completion: { [weak self] error in guard let weakSelf = self else { return } DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { weakSelf.sendPinMessage() } }) } }
Hello @jitendra-simform ,
Can you explain the question a bit more? I've watched the video and I don't see the messages disappearing from the message list?
Hello @jitendra-simform ,
Can you explain the question a bit more? I've watched the video and I don't see the messages disappearing from the message list?
Sure @b-onc , I have sent message 1 to 10 and mark them as pin , one by one as you can see in video , then sent message 11 to 17 and mark them as pin then click back button
Please check video duration at 0.11 and 1.40
thanks

Hello @jitendra-simform ,
Now I've seen the issue in the video, thank you.
I cannot reproduce this issue locally. Can you try the latest develop and let me know?
Hello @b-onc Still facing same issue in v4.16 - Video attached Steps Pinned message using below function
//
open func pinMessage(message: ChatMessage) {
guard let channel = dataSource?.channel(for: self) else {
return
}
let messageController = client.messageController(
cid: channel.cid,
messageId: message.id
)
messageController.pin(MessagePinning.noExpiration, completion: { [weak self] error in
guard let weakSelf = self else { return }
if error != nil {
debugPrint("==== pin error \(error)")
} else {
// On Success sent text message
weakSelf.sendPinMessage(message: message)
}
})
}
On Success sent text message using below function
open func sendPinMessage(message: ChatMessage) {
guard let cid = dataSource?.channel(for: self)?.cid else {
return
}
let channelController = client.channelController(for: cid)
let text = "Message Pinned"
channelController.createNewMessage(text: text, extraData: [:])
}
Please suggest ASAP Thanks
https://user-images.githubusercontent.com/97155807/174745013-e493a0ef-af9f-462a-8556-a05ac048d916.mov
Hey @jitendra-simform
Can you share the altered Demo project you're using for testing? Or create a patch file with your changes and share it here, so we can test.
Hey @jitendra-simform
Can you share the altered Demo project you're using for testing? Or create a
patchfile with your changes and share it
here, so we can test. Hello @b-onc Here is patch file thanks patch.diff.zip
Hi @jitendra-simform,
thanks for the patch! Ill try to reproduce the reported issue.
Good news, I was able to reproduce your issue in DM channel.
Im going to investigate this issue a bit and will come back to you soon!
Hi @jitendra-simform !
The issue will be available in the next 4.21.0 release.
We will let you know once it is published!
Best, Nuno
Hi!
This issue is now solved in the 4.21.1 release.
Thank you for your patience!
Best, Nuno