nudge icon indicating copy to clipboard operation
nudge copied to clipboard

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

Open erikng opened this issue 1 year ago • 2 comments

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

A quick fix was created for https://github.com/macadmins/nudge/issues/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.

erikng avatar Mar 13 '24 15:03 erikng

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

erikng avatar May 31 '24 21:05 erikng

I need help testing https://github.com/macadmins/nudge/releases/tag/v2.0.0.81674 for this issue.

erikng avatar Jul 02 '24 19:07 erikng

I've added some more logic for gracefully handling no network connections and 0byte jsons that fail to decode. I think this will be as good as I can get it without more testers in the field.

erikng avatar Jul 10 '24 16:07 erikng