-
Notifications
You must be signed in to change notification settings - Fork 650
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
[ch149080] Avoid updating analysis nodes more than once when moving layers in Builder #16279
[ch149080] Avoid updating analysis nodes more than once when moving layers in Builder #16279
Conversation
This pull request has been linked to Clubhouse Story #149080: [kqednews] Error reordering layers when the Intersect and Aggregate analysis is present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
Consider adding a test here: https://github.com/CartoDB/cartodb/blob/master/lib/assets/test/spec/builder/data/user-actions.spec.js#L1718
Resources
Context
When a layer is moved in Builder, the analysis node of each layer is updated. The problem starts when a layer contains analysis nodes from other layers. For example, when there are "intersect & aggregate analysis" linking two layers, because when a node is updated, the other nodes from layers that contain that node are also updated. So, the same request is performed more than once, and Maps API sends a
429
error as a result.To avoid that error, since the action to move layers is updating the analysis node of all layers, a flag is being added to save only the node associated with the current layer, instead of the ones from all the layers that contain the node from the current layer.
Changes
moveLayer
action in order to update each analysis node only once.saveAnalysisForLayer
.