Skip to content

Commit 814217f

Browse files
Copilothotlong
andcommitted
fix: address code review - add debug logging and userId/id compat
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent ed43fe1 commit 814217f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/foundation/plugin-formula/src/formula-plugin.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ export class FormulaPlugin implements RuntimePlugin {
137137
const schemaItem = this.kernel.metadata?.get?.('object', objectName)
138138
?? (typeof this.kernel.getObject === 'function' ? this.kernel.getObject(objectName) : undefined);
139139
const schema = schemaItem?.content || schemaItem;
140-
if (!schema || !schema.fields) return;
140+
if (!schema || !schema.fields) {
141+
if (objectName) {
142+
this.logger.debug('No schema found for object, skipping formula evaluation', { objectName });
143+
}
144+
return;
145+
}
141146

142147
// Identify formula fields
143148
const formulaFields: [string, any][] = [];
@@ -168,7 +173,7 @@ export class FormulaPlugin implements RuntimePlugin {
168173
record,
169174
system: systemInfo,
170175
current_user: {
171-
id: session?.userId || '',
176+
id: session?.userId || session?.id || '',
172177
name: session?.name,
173178
email: session?.email,
174179
role: session?.roles?.[0]

0 commit comments

Comments
 (0)