Skip to content

Commit

Permalink
#1088: ensure multi-BU retrieves do not interact badly with each other
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Aug 28, 2023
1 parent 5ac58b3 commit 0faad87
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/metadataTypes/AttributeSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,19 @@ class AttributeSet extends MetadataType {
* @returns {object[]} all system value definitions
*/
static _getSystemValueDefinitions() {
if (!this.systemValueDefinitions) {
this.systemValueDefinitions = Object.values(cache.getCache()['attributeSet'])
this.systemValueDefinitions ||= {};
if (!this.systemValueDefinitions[this.buObject.mid]) {
this.systemValueDefinitions[this.buObject.mid] = Object.values(
cache.getCache()['attributeSet']
)
.flatMap((item) => {
if (item.isSystemDefined) {
return item.valueDefinitions;
}
})
.filter(Boolean);
}
return this.systemValueDefinitions;
return this.systemValueDefinitions[this.buObject.mid];
}
}

Expand Down

0 comments on commit 0faad87

Please sign in to comment.