Skip to content

[gui] Only call fetchStatistics if the filters are ready - #5052

Open
gulyasgergely902 wants to merge 1 commit into
Ericsson:masterfrom
gulyasgergely902:fix-report-callbacks
Open

[gui] Only call fetchStatistics if the filters are ready#5052
gulyasgergely902 wants to merge 1 commit into
Ericsson:masterfrom
gulyasgergely902:fix-report-callbacks

Conversation

@gulyasgergely902

Copy link
Copy Markdown
Collaborator

This change fixes an issue where fetchStatistics were called multiple times even before the reports filters were ready. This made the UI unresponsive at times.

@dkrupp dkrupp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not so fan of timers, because it can introduce flaky behaviour depending on (browser/machine).

Also the debounce mechanism hides multiple sequential events and selects teh first one randomly. Are the filters already loaded then?

I think a much clearer solution would be to define a 1 callback which is fired once all filter is loaded and the data need to be refetched.

  1. filter change
  2. page reload
  3. tab change

@gulyasgergely902
gulyasgergely902 force-pushed the fix-report-callbacks branch 2 times, most recently from e06e7e1 to 082bb38 Compare August 28, 2026 09:33

@dkrupp dkrupp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check my minor comments. otherwise looks good.


function refresh() {
function refresh(reason) {
ccService.getClient().getRunResultCount(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please consider protecting these calls with early return for the case when the filters are not ready yet.


function refreshCurrentTab() {
function emitRefresh() {
bus.emit("refresh");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider clarifying the naming of the refresh to distinguish between "filter refresh" and "statistics refresh" events. This will make the code more understandable.

@gulyasgergely902
gulyasgergely902 force-pushed the fix-report-callbacks branch 2 times, most recently from efe2abe to 055ee8f Compare August 28, 2026 12:45
This change introduces reasons for report filters to why the emit was
invoked. Based on this, it can be filtered when a refresh was actually
needed and when not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants