From 23f4bc54b2657073c60f678c45cf3799bf571a90 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 18 Nov 2026 09:20:54 -0800 Subject: [PATCH] fix(lint): note a table filter made only of references as not checked --- .../application/read-workflow-lint-tables.test.ts | 8 ++++++++ apps/sim/lib/workflows/application/read-workflow-lint.ts | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/sim/lib/workflows/application/read-workflow-lint-tables.test.ts b/apps/sim/lib/workflows/application/read-workflow-lint-tables.test.ts index bc6225c7d3d..e9bb90e7ef9 100644 --- a/apps/sim/lib/workflows/application/read-workflow-lint-tables.test.ts +++ b/apps/sim/lib/workflows/application/read-workflow-lint-tables.test.ts @@ -498,6 +498,14 @@ describe('standalone table diagnostics against the actual Table block', () => { ) }) + it('reports a filter group made only of references as not checked', async () => { + setGraph(block('query', { filter: '{"all":[,]}' })) + const result = await lint() + expect(result.notes).toContain( + 'Table filter in block "query" is not a static query object; its column references were not checked.' + ) + }) + it('does not treat dynamic field names as missing columns', async () => { setGraph(block('query', { sort: '{"":"asc"}' })) const result = await lint() diff --git a/apps/sim/lib/workflows/application/read-workflow-lint.ts b/apps/sim/lib/workflows/application/read-workflow-lint.ts index ee9f9175207..5573b08b224 100644 --- a/apps/sim/lib/workflows/application/read-workflow-lint.ts +++ b/apps/sim/lib/workflows/application/read-workflow-lint.ts @@ -295,8 +295,9 @@ function normalizeTableInputs( * with the same text is never mistaken for one. A quoted reference fits row values and most * filter values; the value of an `in`/`nin` condition must be a list, so it becomes a one-item * list, and a condition or group made only of references has no literal part, so it is left out - * of an `all`/`any` group that keeps a literal member. `runtimeOnly` marks a field whose whole - * value is such a reference or group. + * of an `all`/`any` group that keeps a literal member. A field whose whole value is such a + * reference or group has nothing to check before runtime, so its text becomes one JSON string, + * the same shape a whole-field reference takes, and `runtimeOnly` marks it. */ function withReferencePlaceholders(json: string): { value: string; runtimeOnly: boolean } { const nonce = generateShortId() @@ -340,7 +341,8 @@ function withReferencePlaceholders(json: string): { value: string; runtimeOnly: }) ) } - return { value: JSON.stringify(adapt(parsed)), runtimeOnly: isDynamic(parsed) } + if (isDynamic(parsed)) return { value: JSON.stringify(json), runtimeOnly: true } + return { value: JSON.stringify(adapt(parsed)), runtimeOnly: false } } function replaceBareReferences(json: string, placeholder: (reference: string) => string): string {