Thanks for your efforts! I just gave the refresh example code another try on RSW and saw the same behaviour as before, i.e. the popup window closed but R remains active until I click the "Stop" button. In this session, I'm running R 4.2.1 but I've had the same issue running R 4.1.0.
I'll discuss this next week with our RSW admin, it looks like this is specific to our site. Thanks for providing that insight!
The app opened in a new Browser tab. If I clicked on the "refresh" button, the browser tab greyed out, then reappeared, but the text was not reset to "Test". This also happens if I run the app in the usual manner, then click on the "Open in browser" button.
instead, the app runs in the view pane as expected. If I click the "refresh" button, the view pane becomes empty but R keeps running until I click the "stop" button.
This problem is due to Firefox. If I try it using Chrome, the refresh button works properly. Our RSW admin tried this out on RStudio Connect and got the same results: refresh work on Chrome but not on Firefox. Surprising, RShiny Workgroups/Connect work otherwise fine on Firefox.
I'm using Firefox "102.6.0esr (64-bits)" by the way, and Chrome "Version 108.0.5359.125 (Official Build) (64-bit)". Both are managed by our IT department.