Skip to content

Remove the dead config schema leg from the configuration merge - #1821

Merged
kmcginnes merged 2 commits into
mainfrom
simplify-configuration-merge
Jun 17, 2026
Merged

kmcginnes merged 2 commits into
mainfrom
simplify-configuration-merge

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Jun 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

mergeConfiguration previously merged schema type configs from three sources: the connection config's own schema, the synced schema, and user styling. The first source was always empty — no released code path ever populates RawConfiguration.schema (import splits the bundled schema into schemaAtom, schema sync writes there, and create/default connections never set it). The union-of-keys logic, the mergeAttributes helper, and the unknown-type fallbacks all existed only to service that dead leg.

This drops the dead source, leaving a straightforward two-source merge: synced schema over defaults, with user styling applied on top. Each type now has a single schema source, so those helpers collapse away (−91/+14 in configuration.ts). Behavior is unchanged.

How to read:

  • Start with the second commit (configuration.ts) — the actual change.
  • The first commit is the safety net: regression tests pinned before the refactor, verifying the behavior upgrading users depend on.

Core vs supporting:

  • Core: the configuration.ts simplification.
  • Supporting: two backward-compatibility pins (import splits schema into schemaAtom and never writes it onto the config entry; a backup/restore round-trip preserves a stored config carrying a stray legacy schema field), a faithfully-shaped test fixture, and a cleanup of the surrounding import tests to share one lookup helper.

Validation

  • pnpm checks passes (lint, format, types).
  • pnpm test passes (1789 tests). The pre-existing merge tests pass untouched, which is the primary evidence the refactor is behavior-preserving.
  • The two new BACKWARD COMPATIBILITY — PERSISTED DATA tests were authored before the refactor and verified to fail loudly if the invariants break (mutation-tested).

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

Add regression tests for upgrading users before simplifying the legacy
configuration merge. A realistic exported connection file fixture verifies
import splits the bundled schema into schemaAtom and never writes it onto
the config entry, and a backup/restore round-trip verifies a stored config
carrying a stray legacy schema field survives losslessly.
mergeConfiguration merged schema from three sources: the connection config's
own schema, the synced schema, and user styling. No released writer ever
populates a connection config's schema (import splits it into schemaAtom,
schema sync writes there, and default/create connections never set it), so
that merge leg was always empty.

Drop it, leaving a two-source merge of synced schema over defaults with user
styling applied. Each type now has a single schema source, so the union-of-keys
logic, the mergeAttributes helper, and the unknown-type fallbacks collapse
away. Behavior is unchanged; the merge tests pass untouched. activeConfigSelector
is no longer exported since nothing outside this module used it.
@kmcginnes
kmcginnes marked this pull request as ready for review June 15, 2026 15:48
@kmcginnes
kmcginnes merged commit 2b43ab4 into main Jun 17, 2026
6 checks passed
@kmcginnes
kmcginnes deleted the simplify-configuration-merge branch June 17, 2026 22:58
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.

Remove the dead in-memory schema merge leg from the configuration merge

2 participants