@@ -48,8 +48,16 @@ func LibraryInstallStreamResponseToCallbackFunction(ctx context.Context, downloa
48
48
func (s * arduinoCoreServerImpl ) LibraryInstall (req * rpc.LibraryInstallRequest , stream rpc.ArduinoCoreService_LibraryInstallServer ) error {
49
49
ctx := stream .Context ()
50
50
syncSend := NewSynchronizedSend (stream .Send )
51
- downloadCB := func (p * rpc.DownloadProgress ) { syncSend .Send (& rpc.LibraryInstallResponse {Progress : p }) }
52
- taskCB := func (p * rpc.TaskProgress ) { syncSend .Send (& rpc.LibraryInstallResponse {TaskProgress : p }) }
51
+ downloadCB := func (p * rpc.DownloadProgress ) {
52
+ syncSend .Send (& rpc.LibraryInstallResponse {
53
+ Message : & rpc.LibraryInstallResponse_Progress {Progress : p },
54
+ })
55
+ }
56
+ taskCB := func (p * rpc.TaskProgress ) {
57
+ syncSend .Send (& rpc.LibraryInstallResponse {
58
+ Message : & rpc.LibraryInstallResponse_TaskProgress {TaskProgress : p },
59
+ })
60
+ }
53
61
54
62
// Obtain the library index from the manager
55
63
li , err := instances .GetLibrariesIndex (req .GetInstance ())
@@ -162,6 +170,11 @@ func (s *arduinoCoreServerImpl) LibraryInstall(req *rpc.LibraryInstallRequest, s
162
170
return err
163
171
}
164
172
173
+ syncSend .Send (& rpc.LibraryInstallResponse {
174
+ Message : & rpc.LibraryInstallResponse_Result_ {
175
+ Result : & rpc.LibraryInstallResponse_Result {},
176
+ },
177
+ })
165
178
return nil
166
179
}
167
180
@@ -202,7 +215,11 @@ func ZipLibraryInstallStreamResponseToCallbackFunction(ctx context.Context, task
202
215
func (s * arduinoCoreServerImpl ) ZipLibraryInstall (req * rpc.ZipLibraryInstallRequest , stream rpc.ArduinoCoreService_ZipLibraryInstallServer ) error {
203
216
ctx := stream .Context ()
204
217
syncSend := NewSynchronizedSend (stream .Send )
205
- taskCB := func (p * rpc.TaskProgress ) { syncSend .Send (& rpc.ZipLibraryInstallResponse {TaskProgress : p }) }
218
+ taskCB := func (p * rpc.TaskProgress ) {
219
+ syncSend .Send (& rpc.ZipLibraryInstallResponse {
220
+ Message : & rpc.ZipLibraryInstallResponse_TaskProgress {TaskProgress : p },
221
+ })
222
+ }
206
223
207
224
lm , err := instances .GetLibraryManager (req .GetInstance ())
208
225
if err != nil {
@@ -214,6 +231,11 @@ func (s *arduinoCoreServerImpl) ZipLibraryInstall(req *rpc.ZipLibraryInstallRequ
214
231
return & cmderrors.FailedLibraryInstallError {Cause : err }
215
232
}
216
233
taskCB (& rpc.TaskProgress {Message : tr ("Library installed" ), Completed : true })
234
+ syncSend .Send (& rpc.ZipLibraryInstallResponse {
235
+ Message : & rpc.ZipLibraryInstallResponse_Result_ {
236
+ Result : & rpc.ZipLibraryInstallResponse_Result {},
237
+ },
238
+ })
217
239
return nil
218
240
}
219
241
@@ -231,7 +253,11 @@ func GitLibraryInstallStreamResponseToCallbackFunction(ctx context.Context, task
231
253
// GitLibraryInstall FIXMEDOC
232
254
func (s * arduinoCoreServerImpl ) GitLibraryInstall (req * rpc.GitLibraryInstallRequest , stream rpc.ArduinoCoreService_GitLibraryInstallServer ) error {
233
255
syncSend := NewSynchronizedSend (stream .Send )
234
- taskCB := func (p * rpc.TaskProgress ) { syncSend .Send (& rpc.GitLibraryInstallResponse {TaskProgress : p }) }
256
+ taskCB := func (p * rpc.TaskProgress ) {
257
+ syncSend .Send (& rpc.GitLibraryInstallResponse {
258
+ Message : & rpc.GitLibraryInstallResponse_TaskProgress {TaskProgress : p },
259
+ })
260
+ }
235
261
lm , err := instances .GetLibraryManager (req .GetInstance ())
236
262
if err != nil {
237
263
return err
@@ -245,5 +271,10 @@ func (s *arduinoCoreServerImpl) GitLibraryInstall(req *rpc.GitLibraryInstallRequ
245
271
return & cmderrors.FailedLibraryInstallError {Cause : err }
246
272
}
247
273
taskCB (& rpc.TaskProgress {Message : tr ("Library installed" ), Completed : true })
274
+ syncSend .Send (& rpc.GitLibraryInstallResponse {
275
+ Message : & rpc.GitLibraryInstallResponse_Result_ {
276
+ Result : & rpc.GitLibraryInstallResponse_Result {},
277
+ },
278
+ })
248
279
return nil
249
280
}
0 commit comments