You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Data viewer doesn't auto refresh on source data changing #7066
Notice that the data doesn't update and you have to View(d) again to see it. This must have been broken in the last performance PR on the DataViewer. Instinct says this should be fairly trivial to fix and some watcher just got lost in the mix.
Thanks Darby. I'll play around with different versions and distros. I have a feeling it might be a heisenbug (goes away when I look at it in a dev environment) because the debug/logging infrastructure shunts away the error condition.
Here's the JS callstack when the exception occurs:
It's worth noting that this exception in older versions of RStudio as well (tested back to v1.1). It seems like (as @adamconroy said) there are multiple copies of this DataEditingTarget class receiving data update events here, but only one is actually "live".
We can get a stack trace for each instantiation:
Note that in the first case, we're getting an instantiation as part of getDefaultNamePrefix(); in the second case, we're getting it as part of just getEditingTarget(). That points to code here:
But it seems like those calls to get() are actually producing separate editing targets. Because of that, we end up with multiple editing targets attached to the same document, but with one of those targets being left half-initialized (but still listening for and incorrectly-handling events).
Verified Fixed on: RStudio Version - 1.3.1054, R Version - 4.0.2, Windows 10 - Desktop
Compared functionality between 1.3.1045 and 1.3.1054 builds, pre-fix View(d) has to be run a 2nd time to update the data, with the fix the data is updated immediately after running d <- c(2,0).
Activity
jmcphers commentedon Jun 8, 2020
Reported several times on community forum: https://community.rstudio.com/t/the-data-viewer-does-not-auto-refreshing/68696
adamconroy commentedon Jun 18, 2020
I actually can't reproduce this anymore. I wonder what happened. Could I get a quick sanity check @dfalty or @ronblum ?
dfalty commentedon Jun 22, 2020
Hey @adamconroy, I can reproduce this on my desktop (Mac 10.15.2) on 1.3.1039 but it looks fixed on 1.4.497 for me. Maybe something in 1.4 fixed this?
adamconroy commentedon Jun 22, 2020
Thanks Darby. I'll play around with different versions and distros. I have a feeling it might be a heisenbug (goes away when I look at it in a dev environment) because the debug/logging infrastructure shunts away the error condition.
kevinushey commentedon Jun 26, 2020
Here's the JS callstack when the exception occurs:
It's worth noting that this exception in older versions of RStudio as well (tested back to v1.1). It seems like (as @adamconroy said) there are multiple copies of this
DataEditingTargetclass receiving data update events here, but only one is actually "live".We can get a stack trace for each instantiation:
Note that in the first case, we're getting an instantiation as part of
getDefaultNamePrefix(); in the second case, we're getting it as part of justgetEditingTarget(). That points to code here:rstudio/src/gwt/src/org/rstudio/studio/client/workbench/views/source/SourceColumn.java
Lines 466 to 468 in 075c2c6
In theory, these should be receiving GWT-injected objects here:
https://github.com/rstudio/rstudio/blob/master/src/gwt/src/org/rstudio/studio/client/workbench/views/source/editors/EditingTargetSource.java#L58-L74
But it seems like those calls to
get()are actually producing separate editing targets. Because of that, we end up with multiple editing targets attached to the same document, but with one of those targets being left half-initialized (but still listening for and incorrectly-handling events).kevinushey commentedon Jun 26, 2020
I wonder if this comes down to
isActive_not being set inonActivate()? See e.g.rstudio/src/gwt/src/org/rstudio/studio/client/workbench/views/source/editors/data/DataEditingTarget.java
Lines 120 to 145 in bd1aa6f
We set the flag in the constructor, but it seems like that flag should be set / unset in
onActivate()/onDeactivate().adamconroy commentedon Jun 26, 2020
will give it a go! most of this file hasn't been touched in 5-6 years but I wouldn't be surprised if a change somewhere else broke this.
adamconroy commentedon Jun 26, 2020
Look at that, it works...making a PR now. Great find! We still get the UmbrellaException sadly but at least the DataViewer updates.
R-Hannibal commentedon Jun 29, 2020
Verified Fixed on: RStudio Version - 1.3.1054, R Version - 4.0.2, Windows 10 - Desktop
Compared functionality between 1.3.1045 and 1.3.1054 builds, pre-fix
View(d)has to be run a 2nd time to update the data, with the fix the data is updated immediately after runningd <- c(2,0).