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

Variable Hydration Filtering / Variable loading isn't fully functioning #18192

Closed
asalem1 opened this issue May 21, 2020 · 1 comment · Fixed by #18346
Closed

Variable Hydration Filtering / Variable loading isn't fully functioning #18192

asalem1 opened this issue May 21, 2020 · 1 comment · Fixed by #18346

Comments

@asalem1
Copy link
Contributor

asalem1 commented May 21, 2020

This issue is being written as a fast-follow for a PR to resolve some variable hydration issues we were experiencing due to a recent refactor. The refactor was meant to limit the number of queries that are made when a variable selection is updated. This works too well and has exposed bugs in our current system that is causing variables to act unpredictably. In order to resolve some of the underlying issues, I've created a PR to first revert the functionality with the intention of working through the issues that arose.

@asalem1
Copy link
Contributor Author

asalem1 commented May 29, 2020

UPDATE It seems like the findSubgraph function is incorrect in its current implementation. While it does currently flatten variable relationships out, it fails to execute correctly in certain situations. For example, if three variables are passed in [a, b, c] where a has a relationship to b, and c has no relationship, the output will be an array of [a, b, c] where all of the existing node relationships will be removed and will execute asynchronously, causing problems when we have query variables based on other query variables.

The solution we want to implement is to:

  1. Determine the relationship that the variables have before creating the initial Set that will be filtered and returned
  2. Determine the oldest ancestor (i.e. the parent of all parent nodes), when creating the set to be returned, and have that set in the returned data
  3. Set the data in the set passed on the filtered data.

Using the example listed above, we would want our final output to look like:

[{variable: a, parent: [b]}, {variable: c, parent: []}]

In addition, if the variable that was passed in is X, where X is the parent to Z we would expect our output to be:

[{variable: z, parent: [x]}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant