Skip to content

Commit 6ed532c

Browse files
author
Akos Kitta
committed
Avoid using reportResult if installing lib/core
Closes #1529 Signed-off-by: Akos Kitta <[email protected]>
1 parent 61a11a0 commit 6ed532c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Diff for: arduino-ide-extension/src/node/core-client-provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ export class CoreClientProvider {
370370
);
371371
progressHandler?.reportProgress(message);
372372
},
373-
reportResult: (result) => progressHandler?.reportResult(result),
374373
},
374+
reportResult: (result) => progressHandler?.reportResult(result),
375375
progressId,
376376
})
377377
)

Diff for: arduino-ide-extension/src/node/grpc-progressible.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,17 @@ export namespace ExecuteWithProgress {
163163
* _unknown_ progress if falsy.
164164
*/
165165
readonly progressId?: string;
166-
readonly responseService: Partial<
167-
ResponseService & { reportResult: (result: DownloadResult) => void }
168-
>;
166+
readonly responseService: Partial<ResponseService>;
167+
/**
168+
* It's only relevant for index updates to build a summary of possible client (4xx) and server (5xx) errors when downloading the files during the index update. It's missing for lib/platform installations.
169+
*/
170+
readonly reportResult?: (result: DownloadResult) => void;
169171
}
170172

171173
export function createDataCallback<R extends ProgressResponse>({
172174
responseService,
173175
progressId,
176+
reportResult,
174177
}: ExecuteWithProgress.Options): (response: R) => void {
175178
const uuid = v4();
176179
let message = '';
@@ -252,8 +255,8 @@ export namespace ExecuteWithProgress {
252255
});
253256
}
254257
} else if (phase instanceof DownloadProgressEnd) {
255-
if (url) {
256-
responseService.reportResult?.({
258+
if (url && reportResult) {
259+
reportResult({
257260
url,
258261
message: phase.getMessage(),
259262
success: phase.getSuccess(),

0 commit comments

Comments
 (0)