Skip to content

fix(pupil-dossier): use schema slugs, and _limit, in the timeline view - #627

Closed
rubenvdlinde wants to merge 1 commit into
developmentfrom
fix/pupil-dossier-schema-slugs
Closed

fix(pupil-dossier): use schema slugs, and _limit, in the timeline view#627
rubenvdlinde wants to merge 1 commit into
developmentfrom
fix/pupil-dossier-schema-slugs

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

learniq's development E2E has been red on one spec — pupil-dossier.spec.ts:166, "resolves the registered component ... not a blank/404 shell". This is why.

Defect 1 — titles where slugs belong

PupilDossierTimelineView.fetchSchema() puts its argument straight into the URL path:

generateUrl(`/apps/openregister/api/objects/learniq/${schema}?${query}`)

OpenRegister resolves that segment against the slug the register declares. All six calls passed the PascalCase title:

passed register declares result
DossierNote dossier-note 404
BehaviourIncident behaviour-incident 404
WellbeingCheckIn wellbeing-check-in 404
LearningPlan learning-plan 404
SupportRequest support-request 404
DeliberationRecord deliberation-record 404

Only one ever surfaced in the error, because Promise.all rejects on the first failure — so the log named DossierNote and the other five stayed invisible.

Why this hid for so long: a single-word title survives the round trip (Portfolioportfolio), so the same pattern elsewhere in src/ is genuinely fine. It only bites where the title has more than one word. I swept src/ for multi-word PascalCase in an objects URL — this view was the only live case (LessonProgress in LessonPlayer.vue appears solely in comments).

Defect 2 — a bare control param in the same method

The DeliberationRecord call passed limit=500 without the underscore. OpenRegister applies a bare control param as a property filter, so that asks for rows whose limit field equals 500 and returns an empty list with HTTP 200 — no error, no deliberations, silently. learnerQuery three lines above already used _limit=200; this one call did not.

Verification

  • every slug now checked against lib/Settings/learniq_register.json — all six present
  • eslint clean on the changed file

The docblock also told the next caller to pass a title ('e.g. "DossierNote"'); corrected.

PupilDossierTimelineView asked OpenRegister for six schemas by their
PascalCase TITLE. The value goes into the URL path verbatim:

    /apps/openregister/api/objects/learniq/DossierNote

OpenRegister resolves that segment against the slug the register
declares - `dossier-note` - so every one of the six 404s. This is what
learniq's e2e has been red on:

    [PupilDossierTimelineView] loadAll error
    Error: DossierNote fetch failed: 404

Only ONE of the six ever appeared in that message, because Promise.all
rejects on the first failure. All six were broken:

    DossierNote        -> dossier-note
    BehaviourIncident  -> behaviour-incident
    WellbeingCheckIn   -> wellbeing-check-in
    LearningPlan       -> learning-plan
    SupportRequest     -> support-request
    DeliberationRecord -> deliberation-record

Single-word titles happen to survive this (Portfolio -> portfolio), which
is why the same pattern elsewhere in src/ is fine and why this stayed
hidden: it only bites where the title has more than one word.

Second defect in the same method: the DeliberationRecord call passed
`limit=500` without the underscore. A bare control param is applied by
OpenRegister as a PROPERTY filter, so it asks for rows whose `limit`
field equals 500 and returns an empty list with HTTP 200 - no error, no
deliberations, silently. `learnerQuery` a few lines above already used
`_limit=200`; this one call did not.

Also corrects the fetchSchema docblock, which told the next caller to
pass a title.
@rubenvdlinde

Copy link
Copy Markdown
Contributor Author

Closing in favour of #629. Another session had already opened #622 for the same file, covering the five lookups inside the Promise.all block — I merged that one. #629 carries only what it missed: the sixth lookup (DeliberationRecord, fetched separately after the SupportRequest ids resolve) and the bare limit=500, which OpenRegister applies as a property filter and which would have kept the care chain empty even once the slug was right.

@rubenvdlinde
rubenvdlinde deleted the fix/pupil-dossier-schema-slugs branch August 26, 2026 22:45
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/learniq @ 277b203

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-specs
format
check-l10n-js
check-schema-l10n
composer ✅ 104/104
npm ✅ 650/650
app:check-code ⏭️
info.xml
REUSE
PHPUnit
Newman ⏭️
Playwright
Hydra gates

Quality workflow — 2026-08-26 23:21 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