From b389d33903077af1b76f24e3691b00871e1c9a5a Mon Sep 17 00:00:00 2001 From: zhangtao Date: Tue, 27 Oct 2026 11:27:21 +0800 Subject: [PATCH] bug fixed --- src/semanticValues.js | 4 ++-- tests/semanticValues.test.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/semanticValues.js b/src/semanticValues.js index d2c18ba..3deceb9 100644 --- a/src/semanticValues.js +++ b/src/semanticValues.js @@ -483,12 +483,12 @@ export class SemanticValueRegistry { } } - const overrideRows = await (this.database.listSemanticValueOverridesAsync ?? this.database.listSemanticValueOverrides).call(this.database, { + const overrideRows = (await (this.database.listSemanticValueOverridesAsync ?? this.database.listSemanticValueOverrides).call(this.database, { themeId, sourceType: normalizedSourceType, sourceId: String(sourceId), fieldName: String(fieldName), - }).filter((override) => override.enabled); + })).filter((override) => override.enabled); const excludedValues = new Set( overrideRows .filter((override) => override.action === 'EXCLUDE') diff --git a/tests/semanticValues.test.js b/tests/semanticValues.test.js index b4a4fa5..9f08123 100644 --- a/tests/semanticValues.test.js +++ b/tests/semanticValues.test.js @@ -175,6 +175,8 @@ test('indicator value domains do not consume 本地指标目录 description meta test('dataset value domains cache complete source snapshots without re-scanning', async () => { const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'metric-ask-values-dataset-')); const database = new PlatformDatabase(path.join(directory, 'test.db')); + // Production MySQL/SQLite async repositories return a Promise here. + database.listSemanticValueOverridesAsync = async () => []; const registry = new SemanticValueRegistry(database); const themeId = database.listThemes()[0].id; const fieldKey = semanticValueFieldKey(