[atomic-reuse] Clearing an optional field fails in the pinned Atomic lib adapter #53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Affected path
Scope: atomic-reuse only for this reproduced defect.
/atomic-reuse(AtomicLibDemo+AtomicTable)db-table-editor-native)db-table-editor-atomiceditor on NG ORMAtomicTable.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
Clearing an optional field produces undefined. The adapter passes the change to validated
Resource.set(). In pinned@tomic/lib0.40.0, validation rejects undefined before reaching the removal branch. The old value remains saved and the user cannot clear it.Sources: adapter save, shared field editor, NG deletion path.
The NG path explicitly deletes a field when its new value is undefined; it does not use this failing Atomic setter path.
Reproduction
/atomic-reuse; the initial row has Due =2026-10-20.At adapter level, using the existing setup helper in
tests/unit/atomic-table.test.ts,record.save({ [due]: undefined }, record.values)rejects withValue is undefined, and the old date remains in the Store. This case was reproduced directly.Acceptance
Related: #51 is collection membership; #45 is real Atomic backend work. This is a separate editing defect.
Upstream library report: ontola/atomic-server#2315.
The upstream issue includes a standalone reproduction on
@tomic/lib@0.40.0, the observed error, the documentedset(undefined)removal contract, and the matching validation-before-removal ordering inspected in current upstreamdevelop. The newer checkout was inspected, not executed. CallingResource.remove()explicitly remains a working local adapter workaround. This downstream issue still tracks the/atomic-reuseintegration.Proposed upstream fix: https://github.com/ontola/atomic-server/pull/2317 (fixes https://github.com/ontola/atomic-server/issues/2315).
The corresponding app dependency change is #56. It pins an immutable Git commit containing a narrow backport to the compatible 0.40 library API, including the package preparation needed to install the library from the upstream monorepo. Both the app and @tomic/react resolve the same patched library. Regression coverage includes clearing optional date and text fields.
These are proposed changes; this issue remains open until the app PR is merged.