Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 019b2d5

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Avoid using reportResult if installing lib/core
Closes #1529 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent aa0807c commit 019b2d5

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

‎arduino-ide-extension/src/node/core-client-provider.ts‎

Lines changed: 1 addition & 1 deletion
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
)

‎arduino-ide-extension/src/node/grpc-progressible.ts‎

Lines changed: 8 additions & 5 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /