v4.2.1 #43

Merged
asonix merged 48 commits from v4.2.1-branch into asonix/changes 2023-10-11 17:20:34 +00:00
Showing only changes of commit 8a6fa34040 - Show all commits

View file

@ -35,11 +35,13 @@ class SoftwareUpdateCheckService < BaseService
end
def process_update_notices!(update_notices)
return if update_notices.blank? || update_notices['updatesAvailable'].blank?
return if update_notices.blank? || update_notices['updatesAvailable'].nil?
# Clear notices that are not listed by the update server anymore
SoftwareUpdate.where.not(version: update_notices['updatesAvailable'].pluck('version')).delete_all
return if update_notices['updatesAvailable'].blank?
# Check if any of the notices is new, and issue notifications
known_versions = SoftwareUpdate.where(version: update_notices['updatesAvailable'].pluck('version')).pluck(:version)
new_update_notices = update_notices['updatesAvailable'].filter { |notice| known_versions.exclude?(notice['version']) }