Skip to content

fix(webapp): avoid duplicate /services/search calls when filtering - #2313

Merged
lbroudoux merged 1 commit into
microcks:masterfrom
celidrissi:fix/2297-services-duplicate-search-call
Oct 1, 2026
Merged

lbroudoux merged 1 commit into
microcks:masterfrom
celidrissi:fix/2297-services-duplicate-search-call

Conversation

@celidrissi

Copy link
Copy Markdown
Contributor

Signed-off-by: CHAFIK EL IDRISSI [email protected]

Description

  • Fix duplicate GET /api/services/search call when filtering the services list by domain label: filterServices() both fetched the results and navigated to update the URL, and that navigation re-triggered the queryParams subscription which called filterServices() a second time with the same filter.
  • Same issue when clearing an active filter (duplicate GET /api/services call) — fixed the same way.
  • Fetching and URL navigation are now separated: handleFilter() only updates the URL, and the queryParams subscription remains the single place that triggers the actual API call.
  • Extracted a buildLabelsFilter() helper to remove the duplicated label-map construction between filterServices() and handleFilter().

Testing: Verified manually against a local backend (docker-compose-devmode.yml) + ng serve — checked the Network tab before/after for: applying a domain filter, changing the filter, and clearing it. Each action now triggers exactly one API call instead of two. ng build --configuration=production passes.

AI usage disclosure: I used Claude to help explain the root cause and review the code I wrote myself; no code was generated by AI.

Related issue(s)

Fixes #2297

@github-actions

Copy link
Copy Markdown

👋 @celidrissi

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly.

Hope you have a great time there!

@SebastienDegodez SebastienDegodez 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.

LGTM

@lbroudoux lbroudoux 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.

This looks all good. Thanks for your contribution!

@lbroudoux lbroudoux added this to the 1.16.0 milestone Oct 1, 2026
@lbroudoux
lbroudoux merged commit 802d861 into microcks:master Oct 1, 2026
12 of 13 checks passed
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

🎉 @celidrissi

You are now a Microcks community contributor! 💖

Thanks and congrats 🚀 on merging your first pull request! We are delighted and very proud of you! 👏

📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌"

Kudos and please keep going, we need you 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Services list triggers duplicate search API calls when filtering by domain label

3 participants