Skip to content

fix(controllers): accept string UUIDs on action endpoints#852

Merged
rubenvdlinde merged 3 commits into
developmentfrom
fix/action-controllers-uuid-param-type
May 22, 2026
Merged

fix(controllers): accept string UUIDs on action endpoints#852
rubenvdlinde merged 3 commits into
developmentfrom
fix/action-controllers-uuid-param-type

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Reopening after i18n trunk was merged into development (the original PR auto-closed when its base branch was deleted). This PR retargets to development directly.

All commits from this branch that are not yet on development: see Files Changed for the consolidated diff.

…t, /synchronizations/{id}/run|test

The chain-B/C OR cutover replaced auto-increment integer ids with UUIDs,
but five action-controller methods kept `int $id` parameters:

  SourcesController::test           lib/Controller/SourcesController.php:225
  JobsController::run               lib/Controller/JobsController.php:181
  JobsController::test              lib/Controller/JobsController.php:225
  SynchronizationsController::test  lib/Controller/SynchronizationsController.php:228
  SynchronizationsController::run   lib/Controller/SynchronizationsController.php:277

PHP coerces the inbound UUID string ("77637bae-01ec-4909-9f47-f2236fe7c3b1")
to int by taking the leading digits → 77. ObjectService::find(id: "77",
schema: '<schema>') then raises DoesNotExistException → the catch returns
404 Not Found. Every action-button click in the UI + every Newman
fixture POST to /sources/test/{uuid} silently 404s with no log written.

This is the root cause of the empty openconnector dashboard reported in
#838 — the journey tests "pass" because they
only assert response status, not semantic success, but the underlying
CallService / JobService / SynchronizationService never actually runs.

Switch `int $id` → `string $id` on all 5 methods. Drop the now-redundant
`(string) $id` cast at the `find()` call site (the param is already
a string). Update docblocks (`@param int $id` → `@param string $id ...UUID...`).

Discovered while investigating an empty openconnector dashboard.
Companion bugs filed at OR side:
  - ConductionNL/openregister#1614 — honor x-openregister-archival annotation
  - ConductionNL/openregister#1615 — eager magic-table creation on schema import
Closes #839.
…`sourceId` integer

The openconnector_register.json descriptor declares `call_log.sourceId`
as a legacy integer FK kept "during transition per chain-A REQ-A-008
(cleanup tracked at #821)", and a parallel `source` property typed
`string format=uuid` ($ref to source schema) as the post-chain-B
canonical reference.

`CallService::call()` (and its 3 short-circuit paths for disabled
source / missing location / rate-limited) write `'sourceId' =>
$source->getUuid()` — a UUID string being shoved into the legacy
integer column. Postgres rejects:

    SQLSTATE[22P02]: Invalid text representation: 7
    ERROR: invalid input syntax for type integer:
           "77637bae-01ec-4909-9f47-f2236fe7c3b1"

Switch all four `'sourceId'` keys to `'source'` so the UUID lands in
the correct column. The legacy integer column stays empty (NULL) —
#821 tracks its removal once nothing reads
it anymore.

## Verified end-to-end on the local container

(After ConductionNL/openregister PR #1616 lands the eager magic-table
creation that materialises `oc_openregister_table_65_223`:)

  TRUNCATE oc_openregister_table_65_223;
  // PHP CLI: CallService->call(source: $src, endpoint: '/get');
  → row inserted with `source = '77637bae-...'`, status_code = 200
  GET /api/objects/openregister/api/objects/openconnector/call_log
  → returns the row (after a manual UPDATE _owner='admin' workaround
    pending ConductionNL/openregister#1617 — system-context attribution)

Same fix needed for the JobService / SynchronizationService write paths
(jobId / synchronizationId → job / synchronization) — filed separately
as #841 since those services have additional
complexity (event_message also has the integer-FK problem on
eventId / consumerId / subscriptionId).

Companion changes shipping together in this PR:
- 5 action-controllers `int $id` → `string $id` (the original commit)
- This CallService field-name fix

Both are "chain-B/C cutover type drift" bugs.
…ns' into fix/action-controllers-uuid-param-type
@rubenvdlinde rubenvdlinde merged commit 345449a into development May 22, 2026
13 of 14 checks passed
@rubenvdlinde rubenvdlinde deleted the fix/action-controllers-uuid-param-type branch May 22, 2026 05:16
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openconnector @ 202531e

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 148/148
npm ✅ 674/674
PHPUnit ⏭️
Newman ⏭️
Playwright

Quality workflow — 2026-05-22 05:22 UTC

Download the full PDF report from the workflow artifacts.

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.

1 participant