Skip to content

[Bug Report] Ajax error after long time idle with auth enabled #137

@shrektan

Description

@shrektan

For example, let's say you have the below simple app. Note that the DT table uses ajax when server = TRUE (the server processing mode).

library(shiny)
ui <- fluidPage(DT::DTOutput('tbl'))
server <- function(input, output, session) {
  output$tbl <- DT::renderDT(iris, server = TRUE)
}
runApp(list(ui = ui, server = server))

When with auth enabled (any auth methods), you open the browser and enter the app and everything works fine (like click the page button below the table). However, after long time idle (30 mins or 1 hour), click the page button you will find DT complaints the ajax error. The way to solve is simple: refresh the page or just open a new connection to Shinyproxy and perform the re-login. But it confuses the users a lot.

This is because after long time idle, Shinyproxy requires you to re-login for the new connection but the existing connection is still valid. It has the side-affect that the AJAX posting which the existing app trying to perform will be rejected by the server, because Shinyproxy regards it as a new connection...

The way to solve this I believe is to

  • either disconnect the existing apps whenever the re-login requires (a.k.a, a timeout), or
  • recognize the AJAX connection performed by the existing app as valid / authorized...

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions