Skip to content

Commit e2a0275

Browse files
dependabot[bot]mwbrooksWilliamBergaminzimeg
authored
chore(deps-dev): bump tsd from 0.31.2 to 0.32.0 in /packages/web-api (#2236)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Brooks <[email protected]> Co-authored-by: William Bergamin <[email protected]> Co-authored-by: @zimeg <[email protected]>
1 parent 2601d48 commit e2a0275

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

packages/web-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"sinon": "^20",
6767
"source-map-support": "^0.5.21",
6868
"ts-node": "^10",
69-
"tsd": "^0.31.1",
69+
"tsd": "^0.32.0",
7070
"typescript": "5.3.3"
7171
},
7272
"tsd": {

packages/web-api/src/file-upload.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { Logger } from '@slack/logger';
55

66
import { ErrorCode, errorWithCode } from './errors';
77
import type {
8+
FileThreadDestinationArgument,
89
FileUploadV2,
910
FileUploadV2Job,
1011
FilesCompleteUploadExternalArguments,
@@ -200,10 +201,10 @@ export async function getFileDataAsStream(readable: Readable): Promise<Buffer> {
200201

201202
return new Promise((resolve, reject) => {
202203
readable.on('readable', () => {
203-
let chunk: Buffer;
204-
// biome-ignore lint/suspicious/noAssignInExpressions: being terse, this is OK
205-
while ((chunk = readable.read()) !== null) {
204+
let chunk = readable.read();
205+
while (chunk !== null) {
206206
chunks.push(chunk);
207+
chunk = readable.read();
207208
}
208209
});
209210
readable.on('end', () => {
@@ -240,8 +241,15 @@ export function getAllFileUploadsToComplete(
240241
channel_id,
241242
initial_comment,
242243
};
243-
if (thread_ts) {
244-
toComplete[compareString].thread_ts = upload.thread_ts;
244+
if (thread_ts && channel_id) {
245+
const fileThreadDestinationArgument: FileThreadDestinationArgument = {
246+
channel_id,
247+
thread_ts,
248+
};
249+
toComplete[compareString] = {
250+
...toComplete[compareString],
251+
...fileThreadDestinationArgument,
252+
};
245253
}
246254
if ('token' in upload) {
247255
toComplete[compareString].token = upload.token;

0 commit comments

Comments
 (0)