JohnCoene / firebase

Google FIrebase for shiny
https://firebase.john-coene.com
GNU Affero General Public License v3.0
170 stars 26 forks source link

Bug on RealtimeDatabase #83

Closed noamanemobidata closed 4 months ago

noamanemobidata commented 4 months ago

Hi! We have discovered an issue with the RealtimeDatabase, which is no longer working correctly. I recently completed a project (isolated with renv and docker) and everything was functioning as intended. However, today I noticed that shiny/firebase is no longer reacting to data changes (by modifying directly on the console, for example) and similarly for updates from shiny, they are no longer visible on the database.

library(shiny)
library(firebase)

ui <- fluidPage(
  useFirebase(),
  firebaseUIContainer(),
  actionButton("create", "Create"),
  actionButton("update", "Update")
)

server <- function(input, output, session){
  f <- FirebaseUI$
    new()$
    set_providers(
      google = TRUE
    )$
    launch()

  db <- RealtimeDatabase$
    new()$
    ref("test")$
    on_value("changed")

  observeEvent(input$changed, {
    print(input$changed)
  })

  observeEvent(input$create, {
    f$req_sign_in()

    db$set(list(x = 1, y = 2))
  })

  observeEvent(input$update, {
    f$req_sign_in()

    db$update(list(x = 1, y = runif(1)))
  })

}

shinyApp(ui, server)
$success
[1] FALSE

$response
$response$x
[1] 1

$response$y
[1] 2
noamanemobidata commented 4 months ago

Problem with cookies, deleting them solved the problem