fix: persist site config via setConfig after disableImport#240
Conversation
…sableImport Site save tracks updates through setters; mutating getConfig() alone did not reliably persist import changes. Mirror brand-profile by calling setConfig(Config.toDynamoItem(siteConfig)) before save. Tests mock Config.toDynamoItem and assert setConfig on success paths, and that setConfig is skipped when the site is not found or lookup fails. Made-with: Cursor
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
| */ | ||
|
|
||
| import { ok } from '@adobe/spacecat-shared-http-utils'; | ||
| import { Config } from '@adobe/spacecat-shared-data-access/src/models/site/config.js'; |
There was a problem hiding this comment.
This imports directly from an internal src/ path of the published
package, not from its public entry point. This is fragile — internal
paths can change without a semver bump. It works now but could break on
a lib update.
Ideally Config and toDynamoItem should be exported from the package's
public index.js. Worth checking if there's an alternative export, or
raising it with the shared-data-access team to expose toDynamoItem
publicly.
There was a problem hiding this comment.
Updated the PR, will merge it tomorrow. Thanks!
Use the package root instead of an internal src/models path so semver covers export stability. Align esmock with the new import specifier. Made-with: Cursor
|
This PR will trigger a patch release when merged. |
## [1.12.19](v1.12.18...v1.12.19) (2026-04-01) ### Bug Fixes * persist site config via setConfig after disableImport ([#240](#240)) ([39b9e0a](39b9e0a))
|
🎉 This PR is included in version 1.12.19 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Site save tracks updates through setters; mutating getConfig() alone did not reliably persist import changes. Calling setConfig(Config.toDynamoItem(siteConfig)) before save.
Tests mock Config.toDynamoItem and assert setConfig on success paths, and that setConfig is skipped when the site is not found or lookup fails.
Made-with: Cursor
Please ensure your pull request adheres to the following guidelines:
Related Issues
Thanks for contributing!