Skip to content
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

fix(comms): extend FileSpray.DFUWUFile to change reponse type to text #4131

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
8 changes: 4 additions & 4 deletions packages/comms/src/ecl/dfuWorkunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class DFUWorkunit extends StateObject<UDFUWorkunitState, IDFUWorkunitStat
return this;
}

fetchXML(callback?: void): Promise<FileSpray.DFUWUFileResponse> {
fetchXML(callback?: void): Promise<string> {
return this.DFUWUFile();
}

Expand All @@ -239,14 +239,14 @@ export class DFUWorkunit extends StateObject<UDFUWorkunitState, IDFUWorkunitStat
return retVal;
}

protected DFUWUFile(_request: Partial<FileSpray.DFUWUFileRequest> = {}): Promise<FileSpray.DFUWUFileResponse> {
return this.connection.DFUWUFile({
protected DFUWUFile(_request: Partial<FileSpray.DFUWUFileRequest> = {}): Promise<string> {
return this.connection.DFUWUFileEx({
..._request, Wuid: this.ID
}).then(response => {
//TODO: additional processing?
return response;
}).catch((e: ESPExceptions) => {
return {} as FileSpray.DFUWUFileResponse;
return "";
});
}

Expand Down
4 changes: 4 additions & 0 deletions packages/comms/src/services/fileSpray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export interface UpdateDFUWorkunitEx extends UpdateDFUWorkunitMinusWU {

export class FileSprayService extends FileSprayServiceBase {

DFUWUFileEx(request: FileSpray.DFUWUFileRequest): Promise<string> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should keep the DFUWUFile name (especially since the generated version is invalid).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been able to find a solution to this that doesn't seem like working around the rules. I did come across this answer on SO, which seemed like a good breakdown https://stackoverflow.com/a/62515586. Specifically, the third part where they suggested making the extended type be generic with a default of the preferred type. I thought that might be a good enhancement to the wsdl generator?

return this._connection.send("DFUWUFile", request, "text");
}

SprayFixedEx(request: Partial<FileSpray.SprayFixed>): Promise<FileSpray.SprayFixedResponse> {
return this._connection.send("SprayFixed", request);
}
Expand Down
Loading