@adobe/spacecat-shared-data-access 3.75.0 → 3.75.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [@adobe/spacecat-shared-data-access-v3.75.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.75.1...@adobe/spacecat-shared-data-access-v3.75.2) (2026-06-16)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* pageCitability url-upsert + metrics-store $metadata 404 detection ([#1683](https://github.com/adobe/spacecat-shared/issues/1683)) ([693a943](https://github.com/adobe/spacecat-shared/commit/693a943396fb78db3caf31fd2cb7f643f66bb0ef))
|
|
6
|
+
|
|
7
|
+
## [@adobe/spacecat-shared-data-access-v3.75.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.75.0...@adobe/spacecat-shared-data-access-v3.75.1) (2026-06-15)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* quiet recoverable ERROR-severity log noise (config-validation fallback + missing metrics) ([#1681](https://github.com/adobe/spacecat-shared/issues/1681)) ([27be682](https://github.com/adobe/spacecat-shared/commit/27be6824d60af52a948e168a9a288239b402cdde))
|
|
12
|
+
|
|
1
13
|
## [@adobe/spacecat-shared-data-access-v3.75.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.74.3...@adobe/spacecat-shared-data-access-v3.75.0) (2026-06-15)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/package.json
CHANGED
|
@@ -731,7 +731,7 @@ class BaseCollection {
|
|
|
731
731
|
return this.#queryByIndexKeys(keys, { ...options, limit: 1 });
|
|
732
732
|
}
|
|
733
733
|
|
|
734
|
-
async create(item, { upsert = false } = {}) {
|
|
734
|
+
async create(item, { upsert = false, onConflict } = {}) {
|
|
735
735
|
if (!isNonEmptyObject(item)) {
|
|
736
736
|
const message = `Failed to create [${this.entityName}]: data is required`;
|
|
737
737
|
this.log.error(message);
|
|
@@ -751,7 +751,7 @@ class BaseCollection {
|
|
|
751
751
|
|
|
752
752
|
const prepared = this.#prepareItem(item);
|
|
753
753
|
const payload = this.#toDbRecord(prepared);
|
|
754
|
-
const conflictKey = this.#toDbField(this.idName);
|
|
754
|
+
const conflictKey = this.#toDbField(onConflict ?? this.idName);
|
|
755
755
|
|
|
756
756
|
let query = this.postgrestService.from(this.tableName);
|
|
757
757
|
query = upsert ? query.upsert(payload, { onConflict: conflictKey }) : query.insert(payload);
|
|
@@ -21,7 +21,19 @@ import BaseCollection from '../base/base.collection.js';
|
|
|
21
21
|
class PageCitabilityCollection extends BaseCollection {
|
|
22
22
|
static COLLECTION_NAME = 'PageCitabilityCollection';
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Creates a PageCitability record, upserting on the globally-unique `url` column.
|
|
26
|
+
*
|
|
27
|
+
* The `url` column carries a global unique index (idx_page_citabilities_url_unique),
|
|
28
|
+
* so upserting on `url` makes create idempotent and eliminates the concurrent
|
|
29
|
+
* read-then-insert duplicate-key (Postgres 23505) race observed in production.
|
|
30
|
+
*
|
|
31
|
+
* @param {object} item - the PageCitability data to persist.
|
|
32
|
+
* @returns {Promise<PageCitability>} the created (or updated) PageCitability instance.
|
|
33
|
+
*/
|
|
34
|
+
async create(item) {
|
|
35
|
+
return super.create(item, { upsert: true, onConflict: 'url' });
|
|
36
|
+
}
|
|
25
37
|
}
|
|
26
38
|
|
|
27
39
|
export default PageCitabilityCollection;
|
|
@@ -558,7 +558,9 @@ export const Config = (data = {}) => {
|
|
|
558
558
|
} catch (error) {
|
|
559
559
|
const logger = getLogger();
|
|
560
560
|
if (logger && logger !== console) {
|
|
561
|
-
|
|
561
|
+
// Recoverable: validation failed but we fall back to the provided data,
|
|
562
|
+
// so this is a warning, not an error (avoids prod ERROR-severity noise).
|
|
563
|
+
logger.warn('Site configuration validation failed, using provided data', {
|
|
562
564
|
error: error.message,
|
|
563
565
|
invalidConfig: data,
|
|
564
566
|
});
|