Skip to content

✅ test: Pin Add Entry Flow for Array Config Collections - #110

Open
dustinhealy wants to merge 1 commit into
mainfrom
fix/issue-44-105-array-object-add-entry
Open

✅ test: Pin Add Entry Flow for Array Config Collections#110
dustinhealy wants to merge 1 commit into
mainfrom
fix/issue-44-105-array-object-add-entry

Conversation

@dustinhealy

@dustinhealy dustinhealy commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adding an entry to an array-object collection prepends an empty entry at index 0 while per-entry edits flow through indexed paths like modelSpecs.list.0. Before the applyConfigEdit indexed-merge branch landed in #92, typing into the new entry deleted the pending whole-array edit and left only the bare indexed edit, which then resolved against the baseline array: the new entity overwrote the first existing entry in the UI and in the save payload, and for a previously-unset array the save shipped an indexed fieldPath the backend could not apply as an array, so the toast reported success while nothing persisted. Both reported repros run on v1.0.0, which predates #92; the flows pass on main (verified end to end in the running app for both modelSpecs.list and endpoints.azureOpenAI.groups).

#92 covers the merge with unit tests on applyConfigEdit, but nothing exercised the component flow end to end. This adds integration tests that drive the real SingleFieldRenderer, ArrayObjectField, and ObjectEntryCard through ConfigPage-equivalent state handling (applyConfigEdit, mergeIndexedArrayEdits, buildSavePayload) for both scenarios: typing into a newly added modelSpecs entry must keep the existing entries, and a new entry in a previously-unset endpoints.azureOpenAI.groups array must reach the save payload as the full array path.

Note for deployments: v1.0.0 is the latest release and does not contain #92, so both issues remain reproducible there until a new release is cut.

Fixes #44

Fixes #105

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

Both new tests fail with the applyConfigEdit indexed-merge branch removed and pass on main, pinning the #92 behavior against regression. Both issue flows were also verified live in the running app: on a v1.0.0 checkout the modelSpecs add-entry drops the first existing entry and the azure groups add reports success without persisting; on this branch's base both flows behave correctly. Local gates: full vitest suite passes (801 tests), eslint clean, tsc --noEmit clean.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Adding an entry to an array-object collection prepends an empty entry at index 0, while per-entry edits flow through indexed paths like modelSpecs.list.0. Before the applyConfigEdit indexed-merge branch landed, typing into the new entry deleted the pending whole-array edit and left only the bare indexed edit, which then resolved against the baseline array. The new entity overwrote the first existing entry in the UI and in the save payload, and for a previously-unset array the save shipped an indexed fieldPath the backend could not apply, so the toast reported success while nothing persisted.

The unit tests for applyConfigEdit cover the merge in isolation but nothing exercised the component flow end to end. These tests drive the real SingleFieldRenderer, ArrayObjectField, and ObjectEntryCard through ConfigPage-equivalent state handling (applyConfigEdit, mergeIndexedArrayEdits, buildSavePayload) for both reported scenarios: typing into a newly added modelSpecs entry must keep the existing entries, and a new entry in a previously-unset endpoints.azureOpenAI.groups array must reach the save payload as the full array path. Both fail when the indexed-merge branch is removed and pass on main.
@dustinhealy

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: c2b917717c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dustinhealy
dustinhealy marked this pull request as ready for review August 10, 2026 03:33
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.

[BUG] When adding a new entry in model specs list, old entries get overwritten [Bug] Model Groups not saving

1 participant