Skip to content

fix(settings): force the register import when the computed version differs — completes #391 - #400

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/force-import-when-version-changed
Jul 24, 2026
Merged

fix(settings): force the register import when the computed version differs — completes #391#400
rubenvdlinde merged 1 commit into
developmentfrom
fix/force-import-when-version-changed

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Completes softwarecatalog#391. PR #396 fixed the version signature; live testing then proved that was necessary but not sufficient.

What live testing showed after #396

A normal occ upgrade advanced the stored configuration version (2.4.0+frag.9003c0292.4.0+base.f6e72fc8+frag.92299b19) but did not apply the schema change — the catalog-ratings fragment's auteur/status + fail-closed authorization never reached beoordeeling (schema 43). Root cause is upstream: importFromApp(force:false) advances the stored version without updating existing schemas — filed as ConductionNL/openregister#2075.

That is worse than a plain no-op: the instance looks current while its schemas are stale, and the now-matching version gates off every later correct import.

Fix (consumer side, closes the gap for this app)

New resolveImportForce() reads the version OpenRegister already stores for this app (ConfigurationService::getConfiguredAppVersion() — a like-for-like content-derived comparison against our own computeConfigVersion()) and forces importFromApp() whenever they differ. Matching versions keep the cheap no-op path; an explicit caller force:true still always forces. Commented with the openregister#2075 reference.

Live verification (non-forced path only — the force endpoint was deliberately not used)

  1. Added a throwaway zzTestProbe property to the fragment → GET /api/settings/load (force=false) → log: "force":"false","effective_force":"true"probe present in the DB.
  2. Removed the probe → identical call → probe removed from the DB, stored version back to exactly 2.4.0+base.f6e72fc8+frag.92299b19.
  3. Fragment and appinfo/info.xml diffs confirmed clean afterwards (independently re-verified).

Tests: 465 / 1494 assertions, 0 failures. New SettingsServiceResolveImportForceTest covers versions-differ ⇒ force, versions-match ⇒ no force, explicit-force wins, plus null-stored-version and lookup-exception edges. Spec REQ-003 extended with 3 scenarios.

Note: the previously pre-existing PortfolioReportControllerTest CSV failure (#393) now passes on this HEAD.

🤖 Generated with Claude Code

… stored

OpenRegister's importFromApp(force: false) advances the stored
configuration version whenever any registers/schemas/objects come back
from the import, but does not apply property/authorization changes to
schemas that already exist — only newly-created schemas get the full
payload (ConductionNL/openregister#2075). A register edit that only
touches an existing schema (e.g. catalog-ratings adding auteur/status/
authorization.read to the pre-existing beoordeeling schema) therefore
advanced the stored version, made the instance look up to date, and left
the schema stale — worse than a plain no-op, since the newly-written
version also gated off every later non-forced import.

Add SettingsService::resolveImportForce(): reads back the version
OpenRegister already has stored for this app via
ConfigurationService::getConfiguredAppVersion() (a like-for-like
comparison against our own content-derived computeConfigVersion()
signature) and forces importFromApp() whenever the two differ. Matching
versions keep the existing cheap no-op path. An explicit caller-supplied
force=true still always forces.

Live-verified end-to-end via the non-forced GET /api/settings/load path
(no force:true endpoint used): a throwaway probe property added to
catalog-ratings.json landed on the live beoordeeling schema with
force:false/effective_force:true logged, and removing the probe and
re-running the same non-forced path removed it again and restored the
exact original stored version string.

Adds a ConfigurationService test stub and resolveImportForce() unit
tests, and updates the REQ-003 spec with the new force-when-stale
behavior.
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