MeilCli / slack-upload-file

upload file to slack action
https://github.com/MeilCli/actions
MIT License
31 stars 4 forks source link

files.upload to be discontinued #1090

Open cb-anomitromunshi opened 2 days ago

cb-anomitromunshi commented 2 days ago

[Please easy english or easy japanese]

Feature description

hi, i'm using your action extensively , thanks for the action you provided. Wanted to confirm if you are planning to upgrade the below mention ask . i received this from Slack.

Hello , We want to remind you about an upcoming date and change to the files.upload web API method that affects your UploadApp app on March 11, 2025•  Support for the files.upload API will be discontinued.

To prepare for this change, we recommend migrating away from files.upload and instead using the combination of files.getUploadURLExternal and files.completeUploadExternal. More information on how to use these two APIs together can be found on our Working with files documentation.

MeilCli commented 2 days ago

Currently, this action uses filesUploadV2. ref: https://github.com/slackapi/node-slack-sdk/pull/1544 So, I think your concern is no problem.

EHJ-52n commented 1 day ago

Following the documentation of files.upload (I couldn't find any filesUploadV2 specific API documentation), the need for old applications to update started 8.5.2024 and this action needs to be updated until 11.03.2025. Hence, it is enough time to react. On the other hand, it might be good to know, that you are working on this, or at least have it on your stack, @MeilCli.

MeilCli commented 20 hours ago

I couldn't find any filesUploadV2 specific API documentation

The method isn't api endpoint. Slack node sdk makes convenient method compounding files.getUploadURLExternal and files.completeUploadExternal, and it names filesUploadV2. So, in my understanding, this action has already migrated to the new file uploading api.

EHJ-52n commented 5 hours ago

@MeilCli thank you very much for your time and providing the background details.

I just "checked" the code and the according documentation and post it here for completness.

Code

[...]
async function postByContent(client: slack.WebClient, option: Option): Promise<slack.FilesUploadResponse> {
    if (option.content == undefined) {
        throw Error(`content is undefined`);
    }
    return await client.filesUploadV2({[...]

Documentation

  1. For each file submitted with this method, submit filenames and file metadata to files.getUploadURLExternal to request a URL to which to send the file data to and an id for the file
  2. for each returned file upload_url, upload corresponding file to URLs returned from step 1 (e.g. https://files.slack.com/upload/v1/...\")
  3. Complete uploads files.completeUploadExternal

From my point of view, this issue can be closed.

@cb-anomitromunshi what do you say?