Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shiny::reactiveValues() causes infinite loop #117

Closed
hadley opened this issue Dec 3, 2021 · 3 comments · Fixed by #133
Closed

shiny::reactiveValues() causes infinite loop #117

hadley opened this issue Dec 3, 2021 · 3 comments · Fixed by #133

Comments

@hadley
Copy link
Member

hadley commented Dec 3, 2021

library(shiny)
waldo::compare(reactiveValues(), reactiveValues())
# ... eventually
Error in is_namespaced_call(x) : node stack overflow
@hadley
Copy link
Member Author

hadley commented Mar 9, 2022

Traceback

....
12: compare_by_name(x, y, paths, opts)
11: compare_structure(x_fields, y_fields, paths, opts = opts)
10: compare_structure(x = extract_fun(x, idx[[i]]), y = extract_fun(y, 
        idx[[i]]), paths = c(x_paths[[i]], y_paths[[i]]), opts = opts)
9: compare_by_name(x, y, paths, opts)
8: compare_structure(x_fields, y_fields, paths, opts = opts)
7: compare_structure(x = extract_fun(x, idx[[i]]), y = extract_fun(y, 
       idx[[i]]), paths = c(x_paths[[i]], y_paths[[i]]), opts = opts)
6: compare_by_name(x, y, paths, opts)
5: compare_structure(x_fields, y_fields, paths, opts = opts)
4: compare_structure(x = extract_fun(x, idx[[i]]), y = extract_fun(y, 
       idx[[i]]), paths = c(x_paths[[i]], y_paths[[i]]), opts = opts)
3: compare_by_name(x, y, paths, opts)
2: compare_structure(x, y, paths = c(x_arg, y_arg), opts = opts)
1: waldo::compare(reactiveValues(), reactiveValues())

@hadley
Copy link
Member Author

hadley commented Mar 9, 2022

Inspect the paths reveals the problem:

"new$impl$.allValuesDeps$self$self$self"

@hadley
Copy link
Member Author

hadley commented Mar 10, 2022

Oh because R6 classes are special cased to compare by value, but don't check if they've already seen the environment.

hadley added a commit that referenced this issue Mar 10, 2022
hadley added a commit that referenced this issue Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant