diff --git a/ee/server/service/vpp.go b/ee/server/service/vpp.go index b169e5e0a4..c26f29dda4 100644 --- a/ee/server/service/vpp.go +++ b/ee/server/service/vpp.go @@ -322,7 +322,7 @@ func (svc *Service) BatchAssociateVPPApps(ctx context.Context, teamName string, androidApp, err := svc.androidModule.EnterprisesApplications(ctx, enterprise.Name(), a.AdamID) if err != nil { if fleet.IsNotFound(err) { - return nil, fleet.NewInvalidArgumentError("app_store_id", "Couldn't add software. The application ID isn't available in Play Store. Please find ID on the Play Store and try again.") + return nil, fleet.NewInvalidArgumentError("app_store_id", fmt.Sprintf("Couldn't add software. The application ID %q isn't available in Play Store. Please find ID on the Play Store and try again.", a.AdamID)) } return nil, ctxerr.Wrap(ctx, err, "bulk add app store apps: check if android app exists") } @@ -636,7 +636,7 @@ func (svc *Service) AddAppStoreApp(ctx context.Context, teamID *uint, appID flee androidApp, err := svc.androidModule.EnterprisesApplications(ctx, androidEnterpriseName, appID.AdamID) if err != nil { if fleet.IsNotFound(err) { - return 0, fleet.NewInvalidArgumentError("app_store_id", "Couldn't add software. The application ID isn't available in Play Store. Please find ID on the Play Store and try again.") + return 0, fleet.NewInvalidArgumentError("app_store_id", fmt.Sprintf("Couldn't add software. The application ID %q isn't available in Play Store. Please find ID on the Play Store and try again.", appID.AdamID)) } return 0, ctxerr.Wrap(ctx, err, "add app store app: check if android app exists") } @@ -654,7 +654,7 @@ func (svc *Service) AddAppStoreApp(ctx context.Context, teamID *uint, appID flee return 0, fleet.NewInvalidArgumentError( "app_store_id", fmt.Sprintf( - "Couldn't add software. %s isn't available in Apple Business Manager or Play Store. Please purchase a license in Apple Business Manager or find the app in Play Store and try again.", + "Couldn't add software. %q isn't available in Apple Business Manager or Play Store. Please purchase a license in Apple Business Manager or find the app in Play Store and try again.", appID.AdamID, ), ) @@ -672,7 +672,7 @@ func (svc *Service) AddAppStoreApp(ctx context.Context, teamID *uint, appID flee if len(assets) == 0 { return 0, fleet.NewInvalidArgumentError("app_store_id", - fmt.Sprintf("Error: Couldn't add software. %s isn't available in Apple Business Manager. Please purchase license in Apple Business Manager and try again.", appID.AdamID)) + fmt.Sprintf("Error: Couldn't add software. %q isn't available in Apple Business Manager. Please purchase license in Apple Business Manager and try again.", appID.AdamID)) } asset := assets[0] diff --git a/server/service/integration_android_software_test.go b/server/service/integration_android_software_test.go index 0dca455852..1340458dfe 100644 --- a/server/service/integration_android_software_test.go +++ b/server/service/integration_android_software_test.go @@ -94,7 +94,7 @@ func (s *integrationMDMTestSuite) TestAndroidAppsSelfService() { &addAppStoreAppRequest{AppStoreID: "com.valid.app.id"}, http.StatusUnprocessableEntity, ) - s.Assert().Contains(extractServerErrorText(r.Body), "Couldn't add software. com.valid.app.id isn't available in Apple Business Manager or Play Store. Please purchase a license in Apple Business Manager or find the app in Play Store and try again.") + s.Assert().Contains(extractServerErrorText(r.Body), "Couldn't add software. \"com.valid.app.id\" isn't available in Apple Business Manager or Play Store. Please purchase a license in Apple Business Manager or find the app in Play Store and try again.") // Valid application ID format, but app isn't found: should fail // Update mock to return a 404 @@ -108,7 +108,7 @@ func (s *integrationMDMTestSuite) TestAndroidAppsSelfService() { &addAppStoreAppRequest{AppStoreID: "com.app.id.not.found", Platform: fleet.AndroidPlatform}, http.StatusUnprocessableEntity, ) - s.Assert().Contains(extractServerErrorText(r.Body), "Couldn't add software. The application ID isn't available in Play Store. Please find ID on the Play Store and try again.") + s.Assert().Contains(extractServerErrorText(r.Body), "Couldn't add software. The application ID \"com.app.id.not.found\" isn't available in Play Store. Please find ID on the Play Store and try again.") amapiConfig := struct { AppIDsToNames map[string]string @@ -137,7 +137,7 @@ func (s *integrationMDMTestSuite) TestAndroidAppsSelfService() { &addAppStoreAppRequest{AppStoreID: "com.valid", Platform: fleet.MacOSPlatform}, http.StatusUnprocessableEntity, ) - require.Contains(t, extractServerErrorText(r.Body), "Couldn't add software. com.valid isn't available in Apple Business Manager or Play Store. Please purchase a license in Apple Business Manager or find the app in Play Store and try again.") + require.Contains(t, extractServerErrorText(r.Body), "Couldn't add software. \"com.valid\" isn't available in Apple Business Manager or Play Store. Please purchase a license in Apple Business Manager or find the app in Play Store and try again.") // Add Android app s.DoJSON( diff --git a/server/service/integration_mdm_test.go b/server/service/integration_mdm_test.go index 5e0ef071fc..66bc1e78df 100644 --- a/server/service/integration_mdm_test.go +++ b/server/service/integration_mdm_test.go @@ -12643,7 +12643,7 @@ func (s *integrationMDMTestSuite) TestBatchAssociateAppStoreApps() { {AppStoreID: s.appleVPPConfigSrvConfig.Assets[0].AdamID}, {AppStoreID: "com.app.not.found", Platform: fleet.AndroidPlatform}, }}, http.StatusUnprocessableEntity, "team_name", tmGood.Name) - s.Assert().Contains(extractServerErrorText(resp.Body), "Validation Failed: Couldn't add software. The application ID isn't available in Play Store. Please find ID on the Play Store and try again.") + s.Assert().Contains(extractServerErrorText(resp.Body), "Validation Failed: Couldn't add software. The application ID \"com.app.not.found\" isn't available in Play Store. Please find ID on the Play Store and try again.") s.androidAPIClient.EnterprisesApplicationsFunc = func(ctx context.Context, enterpriseName string, packageName string) (*androidmanagement.Application, error) { return &androidmanagement.Application{}, nil