Other: Fix wrongly installed version

When manually installing an update, we want to manually install the
latest compatible version (`target`), not the absolute latest version
(`latest`). This is obviously a bug in the code because the mutex lock
being locked was `targetLock` but we were wrongly trying to install
`latest`.
This commit is contained in:
James Houlahan
2022-11-18 10:25:11 +01:00
parent 50da1e4704
commit f17b630b12
2 changed files with 2 additions and 1 deletions

View File

@ -277,6 +277,7 @@ func (s *Service) watchEvents() {
safe.RLock(func() {
s.latest = event.Version
}, s.latestLock)
_ = s.SendEvent(NewUpdateVersionChangedEvent())
case events.UpdateAvailable:

View File

@ -530,7 +530,7 @@ func (s *Service) InstallUpdate(ctx context.Context, _ *emptypb.Empty) (*emptypb
defer s.panicHandler.HandlePanic()
safe.RLock(func() {
s.bridge.InstallUpdate(s.latest)
s.bridge.InstallUpdate(s.target)
}, s.targetLock)
}()