microcks / microcks/microcks

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

Open Beginner friendly
#2,297 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

component/ux good first issue kind/bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.