[client] Move the MDM precedence into ResolveUploadURL

Three of the four bundle paths ordered the destinations themselves, each with
its own copy of "MDM first, then what was asked for". Give the resolver the MDM
value as its first argument so the order lives in one place and a call site
cannot express a different one.

Pure refactor: the daemon passes "" for now, matching what it does today, and
the remote job and both mobile SDKs resolve exactly as before.
This commit is contained in:
riccardom
2026-09-25 13:34:17 +02:00
parent c3993bef73
commit b3ee6c9af2
6 changed files with 52 additions and 24 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ func (s *Server) DebugBundle(callerCtx context.Context, req *proto.DebugBundleRe
// it is the operator of this deployment naming their own upload service, and
// the peer already trusts that server for its whole configuration. Only a
// URL the local caller named goes through requirePrivilegeForUploadURL above.
uploadURL := debug.ResolveUploadURL(req.GetUploadURL(), publishedUploadURL)
uploadURL := debug.ResolveUploadURL("", req.GetUploadURL(), publishedUploadURL)
// The upload runs without s.mutex held: it does network I/O to a possibly
// slow destination and must not block the other RPCs that take the lock. The