Services list triggers duplicate search API calls when filtering by domain label
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2k
- Forks
- 370
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 19
Description
### Describe the bug
When filtering the services list by a `domain` label, the UI triggers redundant API calls and does not pass pagination parameters to the search endpoint.
Without a filter, the list correctly calls:
GET /api/services?page=0&size=20
Once a domain filter is applied, the UI additionally calls:
GET /api/services/search?labels.domain=
This request is sent twice instead of making a single paginated search request.
### Expected behavior
When filtering by domain, a **single** request should be made:
GET /api/services/search?labels.domain=example_domain
### Actual behavior
- `GET /api/services/search?labels.domain=example_domain` is called twice instead of once.
- Pagination parameters (`page`, `size`) are not passed to the `/search` endpoint when filtering.
- Inefficient behavior: duplicate requests and mixed usage of `/api/services` vs `/api/services/search`.
### How to Reproduce?
**Reproducer:**
1. Open the Microcks UI and navigate to the services list.
2. With no filter applied, open DevTools → Network tab.
3. Confirm a single call: `GET /api/services?page=0&size=20`.
4. Apply a filter on the `domain` label (e.g. `example_domain`).
5. Observe the network calls.
### Microcks version or git rev
1.14.0
### Install method (`docker-compose`, `helm chart`, `operator`, `docker-desktop extension`,...)
_No response_
### Additional information
**Root cause :**
In `webapp/src/main/webapp/src/app/pages/services/services.page.ts`:
- `route.queryParams.subscribe()` calls `filterServices()`
- `filterServices()` calls the API then `router.navigate()` with query params
- Navigation re-triggers `queryParams`, causing a duplicate `/api/services/search` call
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in webapp/src/main/webapp/src/app/pages/services/services.page.ts, tracing route.queryParams, filterServices(), and router.navigate(). Reproduce the domain-label filter in the browser Network tab, then verify that filtering makes one /api/services/search request with page and size parameters and does not trigger a second request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100