rsconnect icon indicating copy to clipboard operation
rsconnect copied to clipboard

escape codes presented by IDE when target application deleted

Open aronatkins opened this issue 2 years ago • 1 comments

image

Steps to reproduce:

  1. deploy a Shiny application to a Connect server using push-button deployment in the RStudio IDE
  2. delete that Shiny application from Connect
  3. attempt to redeploy using the publish button in the RStudio IDE

This message includes an escape code because the IDE attempts to rewrite the application lookup error with:

https://github.com/rstudio/rstudio/blob/8244ebc49cc3188f04aa26bb2c2377aeda315817/src/cpp/session/modules/SessionRSConnect.R#L212-L218

You can see similar information locally with:

tryCatch({
    rsconnect:::getAppById(appId, account, server, hostUrl)
}, error=function(e)conditionMessage(e))

That produces (redacted by hand):

[1] "\033[38;5;232mCan't find app with id \"APP_ID\"\033[39m\n\033[1mCaused by error in `GET()`:\033[22m\n\033[38;5;232m\033[33m!\033[38;5;232m <https://SERVER_HOSTNAME/__api__/applications/APP_ID> failed with HTTP status 404\nThe requested object does not exist.\033[39m"

The rsconnect:::getAppById() function should produce output that can be included by the IDE in its UI.

aronatkins avatar Nov 09 '23 14:11 aronatkins

Probably need to locally set options(crayon.enabled = FALSE).

hadley avatar Nov 10 '23 15:11 hadley