-
Notifications
You must be signed in to change notification settings - Fork 662
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
Responses from filesUploadV2
have files nested in the files
array
#1803
Comments
Oh weird. Yeah that doesn't seem right 😬 Oh wait.. there's a difference between Damn, I don't think I actually audited This is likely an oversight by me as part of the work to release web-api v7. |
@filmaj no blame at all since this wasn't covered by test! I've even poked this method since that release and didn't catch this until now! The difference between If this does seem unexpected, with the top level |
Yes, unfortunately :( |
Ahh this might be a nice reminder that versioning signals the type of change being made and nothing more, nothing too deep to read into 😰 This is what I'm telling myself. |
Yeah it all depends on the project. web-api doesn't tend to do majors often, so naturally the amount of breaking changes add up over time, so we kind of do it to ourselves. I steward a different open source project that releases major new versions more frequently - maybe two or three times a year - but the backwards incompatibilities are minor and few and far between that most folks are unaffected by upgrading. Top it off with some good upgrade instructions with each major release and it's not actually that painful or scary. I compare it to testing and CI: the less often you test, the more changes batch up, the harder it becomes to test - a negative feedback loop. |
👋 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. |
📝 Per threaded suggestions from the great @filmaj I've added this to the |
Overview
A successful response from uploading files with the
filesUploadV2
API contains afiles
attribute after a request like so:Which means accessing the ID of this file needs:
The first
[0]
index is also consistent when multiple files are uploaded:Expected behaviors
This seems like unexpected behavior so wanted to check - it caught me by surprise! I expected
result.files[0].id
andresult.files[1].id
to have the file IDs 🤔I found the following quick change removes the middle
files[0]
too:node-slack-sdk/packages/web-api/src/WebClient.ts
Line 454 in 1938408
Also noticing a few oddities around typing differences between
filesUploadV2
andfiles.uploadV2
but this doesn't seem so important to me iffilesUploadV2
is the recommended method of file uploads (typings work well here!).Packages:
Select all that apply:
@slack/web-api
Reproducible in:
The Slack SDK version
Node.js runtime version
v20.12.2
OS info
Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
The text was updated successfully, but these errors were encountered: