Skip to content

Commit d446a61

Browse files
Merge branch 'main' into fix-flaky-file-state-store-2
2 parents b562ce0 + 1cb0ea1 commit d446a61

8 files changed

Lines changed: 26 additions & 17 deletions

File tree

packages/cli-hooks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@
6363
"mocha-multi-reporters": "^1.5.1",
6464
"shx": "^0.4.0",
6565
"sinon": "^20.0.0",
66-
"typescript": "5.8.2"
66+
"typescript": "5.8.3"
6767
}
6868
}

packages/cli-test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@
4747
"shx": "^0.4.0",
4848
"sinon": "^20.0.0",
4949
"ts-node": "^10.9.2",
50-
"typescript": "5.8.2"
50+
"typescript": "5.8.3"
5151
}
5252
}

packages/oauth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
"sinon": "^20",
5454
"source-map-support": "^0.5.21",
5555
"ts-node": "^10",
56-
"typescript": "5.8.2"
56+
"typescript": "5.8.3"
5757
}
5858
}

packages/socket-mode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@
7171
"sinon": "^20",
7272
"source-map-support": "^0.5.21",
7373
"ts-node": "^10",
74-
"typescript": "5.7.3"
74+
"typescript": "5.8.3"
7575
}
7676
}

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"devDependencies": {
3333
"@biomejs/biome": "^1.8.3",
3434
"shx": "^0.4.0",
35-
"tsd": "^0.31.0",
35+
"tsd": "^0.32.0",
3636
"typescript": "^5.5.4"
3737
},
3838
"tsd": {

packages/web-api/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@
6161
"mocha": "^11",
6262
"mocha-junit-reporter": "^2.2.1",
6363
"mocha-multi-reporters": "^1.5.1",
64-
"nock": "^13",
64+
"nock": "^14",
6565
"shx": "^0.4.0",
6666
"sinon": "^20",
6767
"source-map-support": "^0.5.21",
6868
"ts-node": "^10",
69-
"tsd": "^0.31.1",
70-
"typescript": "5.3.3"
69+
"tsd": "^0.32.0",
70+
"typescript": "5.8.3"
7171
},
7272
"tsd": {
7373
"directory": "test/types"

packages/web-api/src/WebClient.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'node:fs';
22
import axios, { type InternalAxiosRequestConfig } from 'axios';
33
import { assert, expect } from 'chai';
4-
import nock from 'nock';
4+
import nock, { type ReplyHeaders } from 'nock';
55
import sinon from 'sinon';
66
import {
77
type RequestConfig,
@@ -801,7 +801,7 @@ describe('WebClient', () => {
801801

802802
describe('has an option to set request concurrency', () => {
803803
// TODO: factor out common logic into test helpers
804-
const responseDelay = 100; // ms
804+
const responseDelay = 500; // ms
805805
let testStart: number;
806806
let scope: nock.Scope;
807807

@@ -1102,14 +1102,15 @@ describe('WebClient', () => {
11021102
});
11031103

11041104
it('should throw an error if the response has no retry info', async () => {
1105-
// @ts-expect-error header values cannot be undefined
1106-
const scope = nock('https://slack.com').post(/api/).reply(429, {}, { 'retry-after': undefined });
1105+
const emptyHeaders: ReplyHeaders & { 'retry-after'?: never } = {}; // Ensure that 'retry-after' is not in the headers
1106+
const scope = nock('https://slack.com').post(/api/).reply(429, {}, emptyHeaders);
11071107
const client = new WebClient(token);
11081108
try {
11091109
await client.apiCall('method');
11101110
assert.fail('expected error to be thrown');
11111111
} catch (err) {
11121112
assert.instanceOf(err, Error);
1113+
} finally {
11131114
scope.done();
11141115
}
11151116
});

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)