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

Bug: Widget bindings are not getting updated in Queries. #34237

Closed
rahulbarwal opened this issue Jun 14, 2024 · 1 comment · Fixed by #34248
Closed

Bug: Widget bindings are not getting updated in Queries. #34237

rahulbarwal opened this issue Jun 14, 2024 · 1 comment · Fixed by #34248
Assignees
Labels
Accelerators Product Issues related to app building accelerators Bug Something isn't working Building blocks Building blocks on cavas, on templates listing or drag and drop of building blocks. QA Pod Issues under the QA Pod QA Needs QA attention Widgets & Accelerators Pod Issues related to widgets & Accelerators

Comments

@rahulbarwal
Copy link
Contributor

rahulbarwal commented Jun 14, 2024

When we drag and drop multiple building blocks: widget bindgings are not getting updated int the queries.
For drag and drop of building blocks, Queries and jsObjects are getting refactored in the backend while widgetNames are getting refactored in the frontend.

Approach #1 @jacquesikot

  1. send newly added actions from the backend.
  2. update the bindings when widgets are being added to the canvas.
  3. Run a PUT actions call to update the backend.
  4. Run the added action.

Approach #2 @AnaghHegde

  1. update the widget bindings in the backend itself. This takes care of updating the queries with correct widget names
  2. on the UI only update the widget names if there is a conflict.

This is susceptible to performance issue regression. We have to take good care of not falling into this trap

@rahulbarwal rahulbarwal added Bug Something isn't working Building blocks Building blocks on cavas, on templates listing or drag and drop of building blocks. Templates Product Issues related to Templates labels Jun 14, 2024
@rahulbarwal rahulbarwal self-assigned this Jun 14, 2024
@rahulbarwal
Copy link
Contributor Author

For approach 1: #34237

@appsmith-bot appsmith-bot added the QA Needs QA attention label Jun 27, 2024
@github-actions github-actions bot added QA Pod Issues under the QA Pod and removed Templates Product Issues related to Templates labels Jun 27, 2024
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this issue Jul 10, 2024
…ppsmithorg#34248)

## Description
When multiple blocks of the same type are dropped unto the canvas right
after each other, the query body of the newly created query does not
update the binding to the latest version of the widgets.

## Solution
We have gotten the newlyUpdatedQueries from the block API, then we
update the actionConfiguration.body and the jsonPathKeys to match the
updated binding name for the block and implement the action in the local
state.


Fixes appsmithorg#34237

## Automation
/ok-to-test tags="@tag.Widget"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9644500854>
> Commit: 562ad23
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9644500854&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Widget`

<!-- end of auto-generated comment: Cypress test results  -->






## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced functionality for saving building block widgets to the store.

- **Tests**
  - Updated and added new test cases for pasting building block widgets.

- **Bug Fixes**
- Fixed issues with the import and usage of action types and selectors
in the building block sagas.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@Nikhil-Nandagopal Nikhil-Nandagopal added Accelerators Product Issues related to app building accelerators Widgets & Accelerators Pod Issues related to widgets & Accelerators labels Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accelerators Product Issues related to app building accelerators Bug Something isn't working Building blocks Building blocks on cavas, on templates listing or drag and drop of building blocks. QA Pod Issues under the QA Pod QA Needs QA attention Widgets & Accelerators Pod Issues related to widgets & Accelerators
Projects
None yet
4 participants