Welcome to the new Box Support website. Check out all the details here on what’s changed.

Issue with retrieving metadata of file

New post

Comments

1 comment

  • Ly, Alexander L.

    Seems to be better doing this:

    let metadata = await client.files.getAllMetadata(event.source.id)
    while (metadata.entries.length === 0 || !('topicAreasCovered' in metadata.entries[0])) {
    await new Promise(r => setTimeout(r, 100)) //don't need this, but avoids console spam
    metadata = await client.files.getAllMetadata(event.source.id)
    console.log(metadata)
    }

    but still not a great solution, I think. Does the file get uploaded before metadata is "attached" to the file? It seems strange that the metadata isn't associated immediately, so I'm wondering if it's just a timing, server-side related issue.

    0
    Comment actions Permalink

Please sign in to leave a comment.