Closed noahtalerman closed 1 year ago
@gillespi314 when does Fleet hit the DEP API and clear the flag? If we hit the API on every page in the UI we might want to update the copy in the banner.
Currently the copy tells the IT admin to navigate to the Hosts page to clear the banner. For reference, I saw the banner clear when I navigated to the Host details page.
when does Fleet hit the DEP API and clear the flag?
By my reading, this happens when a server starts up and then every DEP-sync loop (60 seconds by default). If it detects a change, it is supposed to update the flag in the app config. It's not tied directly to any UI actions.
In most cases, UI reloads the app config when the user navigates between main tabs. There might be some exceptions that I can't recall right now.
Update from Martin: IIRC the flag would clear on the next successful API call to Apple's DEP API (once the terms have been accepted). I'm not sure how often/at what frequency those calls are made, though.
Bug has aged out. Moving back to product drafting.
Timebox this to trying to find the missing link for ~2hr otherwise would love to bring a user action button through design if we can't easily find this.
MacosSetupAssistant
job (to assign the profile to devices, calls AssignProfile
)GET /api/_version_/fleet/mdm/apple_bm
endpoint (calls AccountDetail
)GET /api/_version_/fleet/mdm/apple/dep/devices
endpoint (calls FetchDevices
)RegisterProfileWithAppleDEPServer
to ensure the setup assistant (default or custom) is registered with Apple's DEP server. Called from the Worker job mentioned above, and also from the syncer cron job. (calls DefineProfile
)RunAssigner
cron job (job name: "apple_mdm_dep_profile_assigner"), which runs every 1m
by default (the mdm.apple_dep_sync_periodicity
config setting). Is guaranteed to call at least FetchDevices
, may also call SyncDevices
(unless there's a critical error e.g. database down). This is via nanodep
's Syncer.Run
method.1s
.Apple DEP client: updated app config Terms Expired flag
whenever the flag state changes (along with the new value true or false of the flag).T_C_NOT_SIGNED
).The fact that the banner does show up and disappear eventually would indicate that the logic and behavior around detecting the terms changes is working as intended.
In light of this:
@noahtalerman @georgekarrv See my comment above for my findings in the timeboxed investigation.
tl;dr; a) I created and merged a PR which logs without requiring Debug logging when the terms flag changes, b) someone from the frontend should confirm that there's no caching issue on the frontend, c) next terms change we should grab the logs and look at the time-frame of events.
It's possible that ~15 minutes is the time it takes for Apple to reflect the newly-agreed state in the API requests.
Should I move this to "ready for release" as there's nothing to QA for now, or should we keep the ticket active so we do the follow-up steps next time the terms change?
We were able to test this through a real ABM terms change almost immediately, and we could see that:
T_C_NOT_SIGNED
error for over 25 minutes;So the reason for the delay is out of our control, due to how Apple keeps sending the T_C_NOT_SIGNED
error long after the terms were accepted. We should handle that through UX/UI, I'll assign the ticket to @noahtalerman to review the banner text.
Thanks Martin!
Hey @marko-lisica passing this one to you. Do you think we should update the copy?
The decision for this one is to change copy only to make clear that user might need to wait some time for banner to disappear. (see image above)
New copy: Your organization can’t automatically enroll macOS hosts until you accept the new terms and conditions for Apple Business Manager (ABM). An ABM administrator can accept these terms. Done? It might take some time for ABM to report back to Fleet.
@mna @noahtalerman @georgekarrv
Due to the nature of this issue—only being testable when Apple releases new T&Cs—it isn't immediately testable. I have reviewed the copy changes in the linked PR and am comfortable with the decisions made.
@sabrinabuckets FWIW I think you can test this by manually setting a specific flag.
Banner lingers on, Swift sync brings clarity, Fleet's time now aligns.
Fleet version: Observed in Fleet's dogfood environment (commit
8fb694f
)🧑‍💻  Expected behavior
Apple Business Manager (ABM) terms expired. I saw the new terms banner in the Fleet UI. I accepted the new terms on ABM.
I navigated to the Hosts page in Fleet and waited 60 seconds. I refreshed the page. I expected the ABM terms banner in Fleet to be gone because the default interval in which Fleet talks to ABM is 60 seconds (see configuration option here).
đź’Ą Â Actual behavior
It took ~15 mins for the ABM terms banner to dissapear.
More info
A customer also experienced this delay. It took 1 hr+ for the banner to clear.
This customer also had something weird going on with their ABM connection. More in Slack here (internal). Separate issue is captured here: #12958
Code where we connect to DEP: https://github.com/fleetdm/fleet/blob/09e6bf98079cd66eeb0cd8b0f0ba5801ebbebb9e/server/mdm/apple/apple_mdm.go#L531
Original story for the ABM terms banner feature: #8537