[atomic-reuse] Refresh columns and validation after Atomic Class or Property updates #55

Closed
opened 2026-10-19 12:06:04 +02:00 by michielbdejong · 0 comments

Affected path

Scope: atomic-reuse only for this reproduced defect.

Path Affected by this finding?
/atomic-reuse (AtomicLibDemo + AtomicTable) Yes; reproduced with pinned Atomic lib 0.40.0.
NG ORM table editor (db-table-editor-native) Not this implementation defect; it uses a different adapter.
Main db-table-editor-atomic editor on NG ORM Not this implementation defect; despite its name, its record-writing path also uses NG ORM, not AtomicTable.

This scope does not claim that the NG editors have no independent correctness problems. Reproductions used commit be8938078d97a70519a991ade8b9207d07067c5f, and current main's relevant source was checked to match. Temporary focused tests reproduced the defects; no fix or permanent regression test has been added.

Problem

AtomicTable builds its view, columns, requiredness and validators once in the constructor. AtomicLibDemo subscribes to row Resources, but not their Class or Properties. External schema edits therefore leave stale columns and validation, even if a row change later causes a rerender.

The Add text column button explicitly rebuilds the adapter, masking the absence of general schema reactivity.

Sources: constructor metadata snapshot, manual rebuild, row-only subscriptions.

The NG ORM editors use separate runtime-schema subscriptions and compilation, rebuilding the table subtree on a new active schema. Their separately noted risk of losing row drafts during remount is not this stale-Atomic-descriptor finding.

Reproduction

  1. Construct the existing Note table with Title and Count required.
  2. Externally replace the Class Resource in the same Store so only Title is required and Count is optional/recommended, using store.addResources().
  3. Count remains required in adapter.view.columns.
  4. Validating a row containing Title but no Count still throws that Count is required.

This stale-requiredness case was reproduced in a focused adapter test. Source inspection confirms no Class/Property subscriptions; added/removed fields and updated Property labels/types lack the same refresh mechanism.

Acceptance

  • Subscribe to the active Class and referenced Property definitions, cleaning up subscriptions when dependencies change.
  • Refresh columns and validation after changes to fields, labels, requiredness and supported datatypes, without manual rebuilding/reload.
  • Validate saves against the current schema. Show an actionable error for unsupported/incompatible schema changes rather than silently saving under stale rules.
  • Preserve open drafts by stable row/property identity when compatible; retain recoverable input and explain incompatibility otherwise.
  • Add external-schema-update tests, including updates while editing, changed/newly referenced Properties and subscription cleanup.
  • Retain explicit rejection of unsupported constraints/datatypes rather than weakening validation.

Related: #51 is row membership, not schema dependency subscriptions; real Atomic backend work remains #45.

## Affected path **Scope: atomic-reuse only for this reproduced defect.** | Path | Affected by this finding? | | --- | --- | | `/atomic-reuse` (`AtomicLibDemo` + `AtomicTable`) | Yes; reproduced with pinned Atomic lib 0.40.0. | | NG ORM table editor (`db-table-editor-native`) | Not this implementation defect; it uses a different adapter. | | Main `db-table-editor-atomic` editor on NG ORM | Not this implementation defect; despite its name, its record-writing path also uses NG ORM, not `AtomicTable`. | This scope does not claim that the NG editors have no independent correctness problems. Reproductions used commit `be8938078d97a70519a991ade8b9207d07067c5f`, and current main's relevant source was checked to match. Temporary focused tests reproduced the defects; no fix or permanent regression test has been added. ## Problem `AtomicTable` builds its view, columns, requiredness and validators once in the constructor. `AtomicLibDemo` subscribes to row Resources, but not their Class or Properties. External schema edits therefore leave stale columns and validation, even if a row change later causes a rerender. The Add text column button explicitly rebuilds the adapter, masking the absence of general schema reactivity. Sources: [constructor metadata snapshot](https://git.elfaconsortium.eu/ELFA/database-apps/src/commit/be8938078d97a70519a991ade8b9207d07067c5f/shared/atomic/atomicTable.ts#L21), [manual rebuild](https://git.elfaconsortium.eu/ELFA/database-apps/src/commit/be8938078d97a70519a991ade8b9207d07067c5f/apps/db-table-editor-atomic/AtomicLibDemo.tsx#L37), [row-only subscriptions](https://git.elfaconsortium.eu/ELFA/database-apps/src/commit/be8938078d97a70519a991ade8b9207d07067c5f/apps/db-table-editor-atomic/AtomicLibDemo.tsx#L53). The NG ORM editors use separate runtime-schema subscriptions and compilation, rebuilding the table subtree on a new active schema. Their separately noted risk of losing row drafts during remount is not this stale-Atomic-descriptor finding. ## Reproduction 1. Construct the existing Note table with Title and Count required. 2. Externally replace the Class Resource in the same Store so only Title is required and Count is optional/recommended, using `store.addResources()`. 3. Count remains required in `adapter.view.columns`. 4. Validating a row containing Title but no Count still throws that Count is required. This stale-requiredness case was reproduced in a focused adapter test. Source inspection confirms no Class/Property subscriptions; added/removed fields and updated Property labels/types lack the same refresh mechanism. ## Acceptance - Subscribe to the active Class and referenced Property definitions, cleaning up subscriptions when dependencies change. - Refresh columns and validation after changes to fields, labels, requiredness and supported datatypes, without manual rebuilding/reload. - Validate saves against the current schema. Show an actionable error for unsupported/incompatible schema changes rather than silently saving under stale rules. - Preserve open drafts by stable row/property identity when compatible; retain recoverable input and explain incompatibility otherwise. - Add external-schema-update tests, including updates while editing, changed/newly referenced Properties and subscription cleanup. - Retain explicit rejection of unsupported constraints/datatypes rather than weakening validation. Related: #51 is row membership, not schema dependency subscriptions; real Atomic backend work remains #45.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ELFA/database-apps#55
No description provided.