stream-chat-js
stream-chat-js copied to clipboard
`getExportChannelStatus()` return value shows export is stuck with status `'waiting'`
I'm attempting to export the contents of a channel using the following code:
const streamChat = StreamChat.getInstance(/*API key*/, /*API secret*/)
const channelType = 'team'
async function export(channelId: string) {
const { task_id }: APIResponse & ExportChannelResponse = await streamChat.exportChannel(
{
id: channelId,
type: channelType,
},
{
version: 'v2',
},
)
const task: APIResponse & ExportChannelStatusResponse = await streamChat.getExportChannelStatus(task_id)
// Poll every 1000ms.
await until(() => task.status !== 'waiting', 1000)
console.log(task.result)
}
However, task.status is always 'waiting' and task.result never becomes non-null. Am I missing something obvious? What could cause an export task to get stuck in the 'waiting' state?