macadmins / nudge

A tool for encouraging the installation of macOS security updates.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better handling of remote json/files - failures, log events, retries, caching

erikng opened this issue · comments

When using a remote JSON, the network can be unavailable, causing failures.

A quick fix was created for #561 to stop resetting Nudge when in this state.

In the future, it may be ideal to have the following

  • A new key cacheRemoteFiles for the JSON, icons and screenshots. With the newer SwiftUI features, we can gain some of this for free and use it as a fall-back if the admin desires
  • The log events may incorrectly say Current operating system (14.3.1) is greater than or equal to required operating system (0.0) if the admin does not cache. It could be argued that this is the correct behavior, but perhaps we can attempt to read any User key previously written and use that with a different log. Perhaps Current operating system (14.3.1) and the last known required operating system is (x.x).
    • We still do not want to apply a nudge event here because all of the other keys will be missing and Nudge will be unable to infer the "correct" behavior
  • retry logic should be added, perhaps with a configurable amount of seconds so Nudge can attempt to recover before fully exiting.

This is important I think for when people are using the SOFA feature. I need to test this some more.