Closed mkhandium closed 1 year ago
Swiped left on a channel. Tapped the delete button.
Delete the channel.
Got an error with the message
API request failed with status code: 404, code: 16 response: { "code" : 16, "message" : "DeleteChannel failed with error: \"Can't find channel with id messaging:3601A866-9E03-4624-8959-588CFDF84A9C\"", "more_info" : "https:\/\/getstream.io\/chat\/docs\/api_errors_response", "details" : [ ], "StatusCode" : 404, "duration" : "0.00ms" })
This channel was created with type .livestream so I am not sure why the id has messaging in it.
.livestream
messaging
GetStream Chat version: Latest main GetStream Chat frameworks: StreamChat, StreamChatUI iOS version: 16.4 Swift version: 5 Xcode version: 14.3 Device: iPhone 14 Pro Simulator
The UUID string here is correct, but the appended type to the id is wrong when deleting a channel with the default delete action.
FYI Deleting a conversation uses the proper cid if you access it from the more menu, instead of using the trailing delete action button.
Found the related code in the ChatChannelListViewModel
ChatChannelListViewModel
public func delete(channel: ChatChannel) { let controller = chatClient.channelController( for: .init(type: .messaging, id: channel.cid.id) ) controller.deleteChannel { [weak self] error in if error != nil { // handle error self?.channelAlertType = .error } } }
The type is hardcoded to be messaging instead of the channel's actual ChannelType. Opening up a PR for this
ChannelType
Thanks again for the PR that solves this issue 👍
What did you do?
Swiped left on a channel. Tapped the delete button.
What did you expect to happen?
Delete the channel.
What happened instead?
Got an error with the message
This channel was created with type
.livestream
so I am not sure why the id hasmessaging
in it.GetStream Environment
GetStream Chat version: Latest main GetStream Chat frameworks: StreamChat, StreamChatUI iOS version: 16.4 Swift version: 5 Xcode version: 14.3 Device: iPhone 14 Pro Simulator
Additional context
The UUID string here is correct, but the appended type to the id is wrong when deleting a channel with the default delete action.
FYI Deleting a conversation uses the proper cid if you access it from the more menu, instead of using the trailing delete action button.
Found the related code in the
ChatChannelListViewModel
The type is hardcoded to be
messaging
instead of the channel's actualChannelType
. Opening up a PR for this