Skip to content

DossierNote schema 404s at runtime — the learniq register does not resolve during seeding #620

Description

@rubenvdlinde

Symptom

One e2e test fails on development after #610 and #618:

✘ PupilDossierTimelineView route resolves the registered component for a given learnerId
  Error: unexpected fatal errors: [PupilDossierTimelineView] loadAll error
         Error: DossierNote fetch failed: 404

Run: 1 failed, 436 passed, 20 skipped.

This failure is intentional and correct

#618 quieted 404s in PortfolioBuilder, PortfolioReviewView and TakeAssessmentView, because for a single-object lookup a 404 genuinely means "this record is not here" — ordinary user input, not a fault.

PupilDossierTimelineView was deliberately excluded, and this is why. Every call in its loadAll() is a list query:

this.fetchSchema('DossierNote',       `learnerId=${id}&_limit=200`)
this.fetchSchema('BehaviourIncident', )
this.fetchSchema('DossierCheckIn',    )

A learner with no dossier is an empty result set with HTTP 200. A 404 on a list means the schema itself did not resolve. Rendering that quietly as "no dossier found" would report a broken environment as an empty timeline, so the view stays loud — and the test failing is the view doing its job.

The schema is declared, so this is an environment fault

DossierNote appears 8 times in lib/Settings/learniq_register.json (1.16 MB). It is not a missing declaration.

The e2e server log from CI (nextcloud-log-e2e artifact) shows the seed failing to resolve the register at all:

[RegisterMapper] Register does not exist (or is duplicated) before filters  identifier=learniq
[RegisterMapper] Register not found after filters                          identifier=learniq
[MagicMapper]    Failed to find object in register+schema table
                 tableName=openregister_table_14_20
                 error: relation "oc_openregister_table_14_20" does not exist

schema=20 is Course, confirmed by the adjacent line "Discarding 2 properties the schema Course does not declare … schema=20".

Note the wording: "does not exist (or is duplicated)". The lookup fails for learniq twice during its own app's seeding, and the shard table for at least one schema is consequently never created. Whether the cause is absence or duplication is the open question — the message cannot distinguish them, and neither can I from the log alone.

Why it took a routing fix to become visible

Before #610 every e2e navigation used #/… against a createWebHistory router, so all 43 of them rendered the Dashboard. This test "passed" by asserting innerText('body').length > 0 on a page that was never the one under test. The seeding fault has presumably been present the whole time with nothing able to observe it.

What would close this

Determining whether the learniq register is absent or duplicated at seed time, and why the shard tables for its schemas are not created. That is openregister seeding behaviour rather than anything in these views, which is why this is an issue rather than a patch — I would be guessing at a fix, and a wrong guess here writes a quiet fallback over a real infrastructure fault.

Metadata

Metadata

Assignees

Labels

triageAwaiting triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions