nudge icon indicating copy to clipboard operation
nudge copied to clipboard

allowGracePeriods only working in elapsed period

Open pnerum opened this issue 2 years ago • 1 comments

I need more testers to verify if this is an actual issue

It seems that in my testing the allowGracePeriods only works when the macOS client enters the Nudge the "Elapsed period" and not when in "Regular Window Time", "approachingWindowTime" or "imminentWindowTime".

I've tested this with different versions of Mac OS 12: 12.2, 12.3, 12.3.1 and with Nudge versions 1.1.7.81411 and 1.1.8.81422. I deploy Nudge with a configuration profile that points to a json url.

When I check the Nudge log I can see a correct entry during the "Elapsed period", but not during the other periods. Here's an example:

intitialRefreshCycle mode:

2022-08-16 15:39:34.589930+0200 localhost Nudge[4436]: [com.github.macadmins.Nudge:preferences-profile] Profile oVersionRequirements key is empty 2022-08-16 15:39:34.590091+0200 localhost Nudge[4436]: [com.github.macadmins.Nudge:utilities] JSON url: https://fqdn/nudge-testing.json 2022-08-16 15:39:34.819688+0200 localhost Nudge[4436]: [com.github.macadmins.Nudge:preferences-profile] Profile userExperience key is empty 2022-08-16 15:39:34.900818+0200 localhost Nudge[4436]: [com.github.macadmins.Nudge:user-interface] allowGracePeriods is set to true 2022-08-16 15:39:34.900850+0200 localhost Nudge[4436]: [com.github.macadmins.Nudge:user-interface] Device within gracePeriodLaunchDelay, exiting Nudge <-- 2022-08-16 15:39:34.901087+0200 localhost Nudge[4436]: [com.github.macadmins.Nudge:user-interface] Device permitted for gracePeriods - setting date to: 2022-08-16T20:23:497

approachingWindowTime mode:

2022-08-16 15:48:38.499381+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:preferences-profile] Profile osVersionRequirements key is empty 2022-08-16 15:48:38.499551+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:utilities] JSON url: https://fqdn/nudge-testing.json 2022-08-16 15:48:38.729446+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:preferences-profile] Profile userExperience key is empty 2022-08-16 15:48:38.819037+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:user-interface] allowGracePeriods is set to true 2022-08-16 15:48:38.819106+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:preferences-profile] Profile optionalFeatures key is empty 2022-08-16 15:48:38.819161+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:utilities] Major required OS version: 12 2022-08-16 15:48:39.023115+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:user-interface] nudgeRefreshCycle: 60 2022-08-16 15:48:39.030284+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:user-interface] timerCycle: 18000 2022-08-16 15:48:40.092484+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:user-interface] Ignoring Nudge activation - Camera is currently on and not pastRequiredInstallationDate 2022-08-16 15:49:40.139539+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:user-interface] com.apple.Terminal is currently the frontmostApplication 2022-08-16 15:49:40.140228+0200 localhost Nudge[4762]: [com.github.macadmins.Nudge:utilities] Activating Nudge

pnerum avatar Aug 22 '22 13:08 pnerum

I can also confirm this behaviour. I think that the gracePeriodLaunchDelay key should apply to all time states in Nudge, and not just when it's pushed to a device when requiredInstallationDate is close or has elapsed.

smithjw avatar Sep 14 '22 02:09 smithjw

The current logic is this

if (currentDate > PrefsWrapper.requiredInstallationDate) || combinedGracePeriod > getNumberOfHoursRemaining(currentDate: currentDate) {

I disagree that all users should get this grace period. This setting was designed around grace periods for machines being provisioned to reduce the annoyances of a modern MDM enrollment process. If this was globally set, if you had an aggressive nudge event, users would have a smaller window of installation because of this grace period.

Given that my company has had very aggressive nudge events (< 3 days sometimes) I don't plan on implementing this design as it would likely have to require yet another key and additional logic.

erikng avatar Dec 29 '22 16:12 erikng