From 9412daa49c8b148b63eea9c3073c19aee479343e Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 2 May 2023 15:24:07 -0500 Subject: [PATCH] Don't look up application by name on cloud Fixes #808 --- R/deploymentTarget.R | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/R/deploymentTarget.R b/R/deploymentTarget.R index dd1fd98d..09f92b64 100644 --- a/R/deploymentTarget.R +++ b/R/deploymentTarget.R @@ -26,17 +26,20 @@ deploymentTarget <- function(recordPath = ".", } appId <- NULL - # Have we previously deployed elsewhere? - existing <- applications(fullAccount$name, fullAccount$server) - if (appName %in% existing$name) { - thisApp <- existing[appName == existing$name, , drop = FALSE] - uniqueName <- findUnique(appName, existing$name) - - if (shouldUpdateApp(thisApp, uniqueName, forceUpdate)) { - appId <- thisApp$id - appName <- thisApp$name - } else { - appName <- uniqueName + if (!isCloudServer(fullAccount$server)) { + # Have we previously deployed elsewhere? We can't do this on cloud + # because it assigns random app names (see #808 for details). + existing <- applications(fullAccount$name, fullAccount$server) + if (appName %in% existing$name) { + thisApp <- existing[appName == existing$name, , drop = FALSE] + uniqueName <- findUnique(appName, existing$name) + + if (shouldUpdateApp(thisApp, uniqueName, forceUpdate)) { + appId <- thisApp$id + appName <- thisApp$name + } else { + appName <- uniqueName + } } }