slackapi / node-slack-sdk

Slack Developer Kit for Node.js

Home Page:https://slack.dev/node-slack-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

files.upload method returns warning message "files.upload may cause some issues like timeouts for relatively large files."

RyokoKassai opened this issue · comments

I've been using the files.upload API to upload files, but I'm receiving warning messages. Could you provide more details about the warning?

■[WARN] bolt-app "files.upload may cause some issues like timeouts for relatively large files."

I understand that the wrapper function files.uploadV2 is available, but I would like to know the potential risks of continuing to use the Files.upload method as it is.
Here is my question.

  1. Is the warning being triggered because a certain threshold has been exceeded, or does it always appear when the API is called?
  2. What is the threshold for triggering the warning? Is it related to file size or processing time?
  3. What is the threshold for the timeout? Is it related to file size or processing time?

Reproducible in:

The Slack SDK version

"slack/bolt": "^3.17.1"

Node.js runtime version

v20.11.0

OS info

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/suppor

Steps to reproduce:

let outputfile = 'out_20240220121212111.xlsx';   // 11MB file
await client.files.upload({
  channels: 'C04S3M736R3',
  initial_comment: 'Here is your file.',
  file: fs.createReadStream('./' + outputfile),
  filename: outputfile,
  filetype: 'xlsx'
})

Expected result:

No warning message

Actual result:

I'm receiving warning messages.
"files.upload may cause some issues like timeouts for relatively large files."
filesupload_WARN

Requirements

Hey @RyokoKassai 👋 This warning actually originates from the @slack/web-api package, so going to first move the issue!

Oops! Didn't mean to pin. My screen jumped right before clicking "Transfer issue"... But regardles, this warning is hardcoded into SDK for uses of files.upload to encourage using the files.uploadV2 method instead.

Timeout errors were fairly common when uploading larger files with files.upload so a backend change was made to expose new endpoints for uploading files and this method was created in the SDK. As I understand, there's no absolute reason for why these uploads were failing but it was most common with larger files.

The files.uploadV2 method offers much more stability by using a dedicated endpoint for each file upload and should resolve the timeout issues from files.upload. Hopefully this clears a bit up, but I'm also curious if you have any interest in sticking with files.upload?

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.