Skip to content

#1529 Avoid using reportResult if installing lib/core #1530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arduino-ide-extension/src/node/core-client-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ export class CoreClientProvider {
);
progressHandler?.reportProgress(message);
},
reportResult: (result) => progressHandler?.reportResult(result),
},
reportResult: (result) => progressHandler?.reportResult(result),
progressId,
})
)
Expand Down
13 changes: 8 additions & 5 deletions arduino-ide-extension/src/node/grpc-progressible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,17 @@ export namespace ExecuteWithProgress {
* _unknown_ progress if falsy.
*/
readonly progressId?: string;
readonly responseService: Partial<
ResponseService & { reportResult: (result: DownloadResult) => void }
>;
readonly responseService: Partial<ResponseService>;
/**
* 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.
*/
readonly reportResult?: (result: DownloadResult) => void;
}

export function createDataCallback<R extends ProgressResponse>({
responseService,
progressId,
reportResult,
}: ExecuteWithProgress.Options): (response: R) => void {
const uuid = v4();
let message = '';
Expand Down Expand Up @@ -252,8 +255,8 @@ export namespace ExecuteWithProgress {
});
}
} else if (phase instanceof DownloadProgressEnd) {
if (url) {
responseService.reportResult?.({
if (url && reportResult) {
reportResult({
url,
message: phase.getMessage(),
success: phase.getSuccess(),
Expand Down