[Problem/Question]
We rely on metadata
of the channel to display custom UI elements.
We initialize our GroupChannelListProvider.channelListQueryParams
with includeMetaData: true
and indeed metadata is returned.
When sendbird internally refreshes a channel (for example- after going back from a GroupChannel to a GroupChannelList) I see there is an internal Sendbird call initiated by
collectionInstance
.initialize(MessageCollectionInitPolicy.CACHE_AND_REPLACE_BY_API)
that triggers
refreshChannel()
and this API call goes with the following parameters:
show_member: true
show_read_receipt: true
show_delivery_receipt: true
to
https://api-xxxxx.sendbird.com/v3/sdk/group_channels/sendbird_group_channel_yyyyy?show_member=true&show_read_receipt=true&show_delivery_receipt=true
This API call lacks any instructions to get metadata.
It looks like the refreshChannel() is deleting any cachedMetadata
that was previously existed on the channel.
When I inspect the retuned object in the network tab there is no metadata
on it.
Hard-refresh of the app brings back the metadata object, but then after some time it disappears again after refreshChannel()
gets internally called.
[UIKit Version]
"@sendbird/chat": "^4.13.1",
"@sendbird/uikit-react": "^3.14.12",
react 18.3
[Reproduction Steps]
Our channels are Sendbird Desk Tickets.
<GroupChannelListProvider
channelListQueryParams={{
customTypesFilter: ['SENDBIRD_DESK_CHANNEL_CUSTOM_TYPE'],
includeFrozen: true,
myMemberStateFilter: MyMemberStateFilter.JOINED,
unreadChannelFilter: UnreadChannelFilter.ALL,
order: GroupChannelListOrder.LATEST_LAST_MESSAGE,
limit: 100,
includeMetaData: true,
}}
...
/>
- Select the channel from the list (we have a custom list where we use
channel.cachedMetadata
) - play around, send messages, go back to list (when Sendbird internally triggers
refreshChannel
, I don’t know when). - Observe the network, see no
metadata
is returned. Andchannel.cacehdMetadata
get emptied in some way.
[Frequency]
Whenever refreshChannel()
is called internally.