ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.95k stars 3.41k forks source link

[Meta] Multiple API Requests being made when unnecessary #10655

Open akus062381 opened 3 years ago

akus062381 commented 3 years ago

Please confirm the following

Summary

Certain places in Tower, where API requests are being sent and received, multiples (duplicates) of requests are being made when unnecessary. See screenshots:

When creating and saving a new schedule only inside of a workflow template: image

When creating a new group inside of an inventory: image

When visiting the details page of a workflow template: image

AWX version

4.0

Installation method

docker for mac

Modifications

no

Ansible version

No response

Operating system

No response

Web browser

No response

Steps to reproduce

Create a schedule inside a workflow template. When clicking save, take note of API duplicate requests (4 of each) on network tab.

Access details page for a workflow template. Take note of duplicate requests on network tab.

Create a group inside an inventory. When clicking save, take note of API duplicate requests on network tab.

Expected results

One of each necessary request should be made.

Actual results

multiples are being received.

Additional information

No response

nixocio commented 3 years ago

Possible related to: https://github.com/ansible/awx/issues/10551

akus062381 commented 2 years ago

Additional spot:

image

akus062381 commented 2 years ago

image

I found another place where this is happening. This is when i disassociated 2 teams at one time. I confirmed that 3 POST requests are happening per each team.

keithjgrant commented 2 years ago

As I dug into this, I discovered that the function to update breadcrumbs is setting state, which causes a re-fetch of the inventory, which triggers more updates/re-fetches in the child components. Basically a few hooks activating each other more times than they should between various components. Fixing this will require some re-thinking how we go about updating breadcrumbs and/or looking for a way to pull the state vars out of that update function.

akus062381 commented 2 years ago

confirmed as fixed as of 12/20:

Associating a group to a host on the groups tab inside of a host Associating a team to a user