frankgiordano / PlatformTracker

A rudimentary helpdesk type application.
3 stars 0 forks source link

Search list sometimes does not render the last search query results performed in Incident Search page when changing owner filter to current logged in User. #176

Closed frankgiordano closed 3 years ago

frankgiordano commented 3 years ago

This is a problem I have seen on and off where multiple getData calls produce multiple backend query requests and the last request even through is successfully retrieved by the callback function, the list on the UI may not be updated.

I dealt with this problem in the past by using the following convention:

$scope.$evalAsync(function () { $scope.data = response; });

Or removing $evalAsync function and using the following:

$scope.data = response; $scope.$apply();

both techniques did not help.

What I noticed is that I handled this situation in the past with a workaround adding an additional call getData() when setting the owner dropdown filter to the current logged in user when entering Incident Search page for the first time.

What it seems this additional call no longer works around the timing/digest issue in angularJS which can be tricky to handle.

I see I made changes to getData() method since then to streamline duplicate queries from executing due to all the triggering happening via watchers, etc.

I will create a new method called getDataWithOutChecks to force another duplicate query to be performed in this case only to fix this issue.

frankgiordano commented 3 years ago

adding new method getDataWithOutChecks seems to resolve the issue