Closed Cheos137 closed 3 weeks ago
Hi @Cheos137, thanks for taking the time to write in. Indeed, this bug existed in past versions (older versions before v1.39.3), but it was resolved by this PR: https://github.com/slackapi/java-slack-sdk/pull/1316 Could you try the latest version out?
as shown by the dependency graph above, i'm using bolt 1.1.6
with api client/model 1.40.3
, checking the pull request i can confirm that line 2341 (HEAD) / 2243 (before pr) / 2239 (with pr applied) where this issue lies is not touched at all by #1316.
I've opened an accompanying PR #1346 to fix this.
@Cheos137 Thank you so much for taking the time to write code to resolve this issue!
Uploading multiple files using the 'not mainly used for backwards compatibility' overrides filename of all
FilesUploadV2Request.UploadFile
objects passed tocom.slack.api.methods.impl.MethodsClientImpl#filesUploadV2
viacom.slack.api.methods.request.files.FilesUploadV2Request#uploadFiles
.Reproducible in:
The Slack SDK version
1.1.6
/ model1.40.3
Java Runtime version
(version-independent/this information is irrelevant)
OS info
(version-independent/this information is irrelevant)
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., pom.xml/build.gradle))
filesUploadV2
method (it doesn't matter if theFilesUploadV2Request#filename
field is blank/null or set to any value)Uploaded File
(if null was passed) or the passedFilesUploadV2Request#filename
(this is mainly for backward compatibility - using uploadFiles instead is recommended)
com.slack.api.methods.impl.MethodsClientImpl
, line 2341) and confirm the errorExpected result:
The filenames don't get overridden
Actual result:
All filenames are replaced with one single value
How to fix:
in
com.slack.api.methods.impl.MethodsClientImpl
on line 2341, replace the call toreq.getFilename()
with a call touploadFile.getFilename()
. This seems to be a simple copy-paste error - though i think it might be useful to check the entire method for additional errors i might've overlooked.Requirements
Please make sure if this topic is specific to this SDK. 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. :bow:
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.