Closed Robinlovelace closed 4 years ago
I put it there because without it, and with this PR in current form, I get
Warning: Error in observeEventHandler: object 'net' not found
[No stack trace available]
For me locally at least, the only way for the observeEvent
handlers to process the net
object is with the global assignment operator. Does it really work for you without it?
Yes I can reproduce that issue now:
remotes::install_github("atfutures/upthat", "no<<-")
#> Skipping install of 'upthat' from a github remote, the SHA1 (325e50c2) has not changed since last install.
#> Use `force = TRUE` to force installation
upthat::runUpthat()
#> Loading required package: shiny
#>
#> Listening on http://127.0.0.1:3507
#> Reading this matching file: /home/robin/R/x86_64-pc-linux-gnu-library/3.6/upthat/net.Rds
#> Registered S3 method overwritten by 'jsonify':
#> method from
#> print.json jsonlite
#> Warning: Error in observeEventHandler: object 'net' not found
Created on 2019-11-28 by the reprex package (v0.3.0)
Fixed on latest commit: please try to reproduce the reprex above @mpadge, I'm pretty sure it's fixed now.
Ha, interesting - just discovered that no<<-
is not really a valid branch name - I can't check it out locally. But the code doesn't seem right, alas :disappointed: for 2 reasons:
if
clause does nothing in the following, because matching_file
is then simply ignored from the point on:
if (length(matching_file) > 1) {
matching_file = matching_file[1]
} else if (length(matching_file) == 1) {
...
net = readRDS(matching_file)
}
net
is not updated at all, but remains as the initially loaded version, which is the demo data for Kathmandu. The new data are read on input$city
, but those data are not passed beyond the observeEvent
environment, and so are not updated on the output. This was the original reason why I tried replacing =
with <<-
, which seemed at that time to work, and would still appear from my perspective to be necessary here.Sorry to be the bearer of bad news there ...
Ha, interesting - just discovered that no<<- is not really a valid branch name - I can't check it out locally. But the code doesn't seem right, alas disappointed for 2 reasons:
It is. Try
git checkout 'no<<-'
But you're right about it never changing...
ah, okay, thanks: 'no<<'
works, but no<<-
fails. file for future reference!
Heads-up @mpadge I've tested with the more conventional assignment operator and it seems to work. Putting as a PR as I'm unsure why you set it to
<<-
and want to ensure I'm not missing anything.