The PREV_TARGET variable was defined as a Shiny-wide global constant such that it could be shared between user sessions. However, each user session modifies PREV_TARGET out of its own environment with <<- which means the constant is changing for other users! Move PREV_TARGET to be defined in the beginning of the server function to keep it tied to a particular user session.
The
PREV_TARGET
variable was defined as a Shiny-wide global constant such that it could be shared between user sessions. However, each user session modifiesPREV_TARGET
out of its own environment with<<-
which means the constant is changing for other users! MovePREV_TARGET
to be defined in the beginning of theserver
function to keep it tied to a particular user session.