Bookmarking bug (or documentation required): only last setBookmarkExclude() is respected
I have an app with several inputs that have long names that I want to exclude from bookmarking. I didn't see anywhere in the documentation, online or in roxygen, that setBookmarkExclude() should only be called once, so I assumed I would be able to call the function many times in a row. It turns out that it overwrites the previous ones. So something like this
setBookmarkExclude("t1")
setBookmarkExclude("t2")
setBookmarkExclude("t3")
Will only exclude t3 from bookmarking. Either this is a bug, or it should be mentioned in the documentation that this will not work. Maybe it is mentioned somewhere and I just didn't see it!
You can do this like so today:
setBookmarkExclude(c(session$getBookmarkExclude(), "t1")
setBookmarkExclude(c(session$getBookmarkExclude(), "t2")
setBookmarkExclude(c(session$getBookmarkExclude(), "t3")
Also, note that setBookmarkExclude only overwrites other calls to setBookmarkExclude within the same module--or, if called at the top-level server function, it overwrites other calls from the top-level server function.
This works too :joy:
moduleServer(NULL, function(input, output, session) {
setBookmarkExclude("t1")
})
moduleServer(NULL, function(input, output, session) {
setBookmarkExclude("t2")
})
moduleServer(NULL, function(input, output, session) {
setBookmarkExclude("t3")
})
Eek. I agree with the tears part of the emoji, not with the smiling part.
If I write a shiny app, then it is possible for me to list exclude all the IDs I want.
But what about as a package author? If I create inputs in a package, and I want any future user who writes a shiny app that uses my package to not include these inputs in their bookmarks, is there a way to achieve that?
So what is the verdict here, is this a bug or a feature?