Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getExportChannelStatus() return value shows export is stuck with status 'waiting' #1163

Open
mcevoypeter opened this issue Aug 22, 2023 · 0 comments

Comments

@mcevoypeter
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant