0.3.21
This commit is contained in:
@@ -119,7 +119,17 @@ func effectiveUpdatePolicy(policy appupdate.Policy) appupdate.Policy {
|
||||
}
|
||||
|
||||
func (s *Server) updateDecision(r *http.Request) appupdate.Decision {
|
||||
return appupdate.Decide(effectiveUpdatePolicy(s.updatePolicy.get()), clientVersion(r))
|
||||
policy := effectiveUpdatePolicy(s.updatePolicy.get())
|
||||
if identity := identityFrom(r.Context()); identity != nil && identity.userID != "" {
|
||||
if forced, err := s.store.ForcedUpdate(r.Context(), identity.userID); err == nil && forced != "" {
|
||||
if appupdate.CompareVersions(clientVersion(r), forced) >= 0 {
|
||||
_ = s.store.ClearForcedUpdate(r.Context(), identity.userID)
|
||||
} else if policy.Enabled && policy.DownloadURL != "" && (policy.MinimumVersion == "" || appupdate.CompareVersions(policy.MinimumVersion, forced) < 0) {
|
||||
policy.MinimumVersion = forced
|
||||
}
|
||||
}
|
||||
}
|
||||
return appupdate.Decide(policy, clientVersion(r))
|
||||
}
|
||||
|
||||
// mustRetireForUpdate is narrower than "mandatory": an operator may temporarily force a
|
||||
|
||||
Reference in New Issue
Block a user