Skip to content

fix(sites): deep-merge hlxConfig/deliveryConfig on PATCH to preserve content.source (SITES-49362) - #3012

Draft
mimchome wants to merge 1 commit into
mainfrom
fix/sites-hlxconfig-deep-merge
Draft

fix(sites): deep-merge hlxConfig/deliveryConfig on PATCH to preserve content.source (SITES-49362)#3012
mimchome wants to merge 1 commit into
mainfrom
fix/sites-hlxconfig-deep-merge

Conversation

@mimchome

@mimchome mimchome commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

https://jira.corp.adobe.com/browse/SITES-49362

  • Problem: updateSite replaced hlxConfig and deliveryConfig as whole objects. A PATCH sending hlxConfig with only rso+code (no content) silently erased hlxConfig.content.source, breaking crosswalk sites (deploy reports "Site setup incomplete").
  • Fix: Deep-merge hlxConfig/deliveryConfig sub-keys into the existing value. Omitted sub-keys keep their existing value; a plain object merges recursively; arrays/scalars replace; an explicit null deletes a sub-key so callers can still remove one intentionally. Omitting the field entirely leaves it unchanged (unchanged behavior).
  • Safe by default: every caller now preserves omitted sub-keys automatically — no client change needed to stop the data loss.
  • authoringType handling and the hlxConfigChanged/deliveryConfigChanged deepEqual checks are unchanged (they now compare against the merged result).
  • Tests: added unit tests in test/controllers/sites.test.js — partial hlxConfig preserves existing content.source; hlxConfig.content: null deletes it; omitting hlxConfig leaves it unchanged; plus the same partial-merge case for deliveryConfig. Full sites controller suite passes (341) and lint is clean.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

This PR will trigger a patch release when merged.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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