Skip to content

feat(registry) #33 Give the service ids in the error on duplicate client codes - #34

Merged
njoubert-cleverage merged 2 commits into
mainfrom
33
Oct 2, 2026
Merged

njoubert-cleverage merged 2 commits into
mainfrom
33

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #33.

Two clients with the same code made every REST process fail with Client <code> is already defined, without telling which services are in conflict (they usually share the same class).

  • RegisterClientsPass (new): registers the services tagged cleverage.rest.client in ClientRegistry with their service id, replaces the generic RegistryCompilerPass
  • ClientRegistry::addClient(): new optional $serviceId argument; on a duplicate code, the message gives the ids of both services (unchanged message when an id is missing)
  • ClientRegistryTest, RegisterClientsPassTest (new)
  • reference/client.md: update the note on unique codes

Checked with process-bundle-demo, with a second app.cleverage_rest_process.client.apicarto_ign_duplicate client service with the apicarto_ign code: demo.rest.get now fails with Client apicarto_ign is already defined by service "app.cleverage_rest_process.client.apicarto_ign", cannot register service "app.cleverage_rest_process.client.apicarto_ign_duplicate"; without the duplicate, it still runs successfully.

Same change in cleverage/cache-process-bundle#26 and cleverage/soap-process-bundle#27 (see the related issues).

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None: the new argument of ClientRegistry::addClient() is optional, only the exception message changes.

🤖 Generated with Claude Code

…ent codes

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 7c42d1d into main Oct 2, 2026
3 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Give the service ids in the error on duplicate client codes

1 participant