appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.2k stars 3.7k forks source link

[Bug]: Update action API is being called multiple times even when nothing has been updated #16799

Open ankitakinger opened 2 years ago

ankitakinger commented 2 years ago

Is there an existing issue for this?

Description

When I edit an application, clicking on any existing API/Query triggers the update action API on the first load. This API is also triggered when I switch tabs on the API/Query edit page. These are some unnecessary API calls that shouldn't be happening.

API - {{baseUrl}}/api/v1/actions/:actionId

https://www.loom.com/share/bec951043ea64aaf96fa2cb9c98ac58a

Steps To Reproduce

  1. Go to any application edit screen.
  2. Click on any of the API/Query which already exists in that application.
  3. Notice that the update action API is being called when you have not made any change, you simply clicked and landed on the API/Query edit screen.
  4. Now, without making any changes, just switch the current tab (Headers) to the next (Params). Notice that the update API is called again.

Public Sample App

No response

Version

Cloud / Self Hosted - Latest

sribalajig commented 1 year ago

@ChandanBalajiBP can you please put your findings on this ticket

ChandanBalajiBP commented 1 year ago

This issue is caused by the @@redux-form/ARRAY_PUSH event being triggered on opening the API/Queries page. This is the side effect of using the redux form. There is a workaround for this, but this can lead to other issues.

sribalajig commented 1 year ago

@ChandanBalajiBP can you document what is the performance impact of this issue?