@@ -48,8 +48,16 @@ func LibraryInstallStreamResponseToCallbackFunction(ctx context.Context, downloa
4848func (s * arduinoCoreServerImpl ) LibraryInstall (req * rpc.LibraryInstallRequest , stream rpc.ArduinoCoreService_LibraryInstallServer ) error {
4949 ctx := stream .Context ()
5050 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+ }
5361
5462 // Obtain the library index from the manager
5563 li , err := instances .GetLibrariesIndex (req .GetInstance ())
@@ -162,6 +170,11 @@ func (s *arduinoCoreServerImpl) LibraryInstall(req *rpc.LibraryInstallRequest, s
162170 return err
163171 }
164172
173+ syncSend .Send (& rpc.LibraryInstallResponse {
174+ Message : & rpc.LibraryInstallResponse_Result_ {
175+ Result : & rpc.LibraryInstallResponse_Result {},
176+ },
177+ })
165178 return nil
166179}
167180
@@ -202,7 +215,11 @@ func ZipLibraryInstallStreamResponseToCallbackFunction(ctx context.Context, task
202215func (s * arduinoCoreServerImpl ) ZipLibraryInstall (req * rpc.ZipLibraryInstallRequest , stream rpc.ArduinoCoreService_ZipLibraryInstallServer ) error {
203216 ctx := stream .Context ()
204217 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+ }
206223
207224 lm , err := instances .GetLibraryManager (req .GetInstance ())
208225 if err != nil {
@@ -214,6 +231,11 @@ func (s *arduinoCoreServerImpl) ZipLibraryInstall(req *rpc.ZipLibraryInstallRequ
214231 return & cmderrors.FailedLibraryInstallError {Cause : err }
215232 }
216233 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+ })
217239 return nil
218240}
219241
@@ -231,7 +253,11 @@ func GitLibraryInstallStreamResponseToCallbackFunction(ctx context.Context, task
231253// GitLibraryInstall FIXMEDOC
232254func (s * arduinoCoreServerImpl ) GitLibraryInstall (req * rpc.GitLibraryInstallRequest , stream rpc.ArduinoCoreService_GitLibraryInstallServer ) error {
233255 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+ }
235261 lm , err := instances .GetLibraryManager (req .GetInstance ())
236262 if err != nil {
237263 return err
@@ -245,5 +271,10 @@ func (s *arduinoCoreServerImpl) GitLibraryInstall(req *rpc.GitLibraryInstallRequ
245271 return & cmderrors.FailedLibraryInstallError {Cause : err }
246272 }
247273 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+ })
248279 return nil
249280}
0 commit comments