Skip to content

Generate no lookup conf for an unnamed variable - #250

Merged
nandanrao merged 1 commit into
mainfrom
fix/lookup-confs-skip-unnamed-variables
Aug 27, 2026
Merged

Generate no lookup conf for an unnamed variable#250
nandanrao merged 1 commit into
mainfrom
fix/lookup-confs-skip-unnamed-variables

Conversation

@nandanrao

Copy link
Copy Markdown
Contributor

name is both the output variable name and the key into the ad's frozen
ad_attributions row, so a lookup conf without one reads nothing off the row
while presenting itself in the form as configured — a filled-in row that can
only ever yield nothing.

The guard was variables.length === 0, which one unnamed variable passes: its
length is 1.

-  if (source !== FLY_SOURCE || variables.length === 0) return [blankConf()];
-  return variables.map(lookupConf);
+  if (source !== FLY_SOURCE) return [blankConf()];
+  const named = variables.filter(name => !!name);
+  return named.length ? named.map(lookupConf) : [blankConf()];

Also pins two ref_mode properties that held but were untested: a conf stating
an explicit mode keeps it through an unrelated edit, and a mode matching what
was loaded does not warn.

Provenance. Found by comparing what shipped in #247 against
feature/ref-mode-dashboard-ux (#246), which built the same design
independently and carries generateLookupConfs.test.ts covering this case. An
AST-level comparison showed adopt and swoosh are behaviourally identical between
the two implementations — events.go byte-identical, and the only differences
in study_conf.py / marketing.py / csv_export.py are one variable rename,
one tightened optional parameter, and one error-message wording. This was the
one real gap.

Both new generateLookupConfs tests fail without the fix.

npx tsc --noEmit        clean
CI=true npx craco test  170 passed, 15 suites  (was 166)
CI=true npx craco build Compiled successfully

Dashboard only — Netlify deploys from main on merge.

🤖 Generated with Claude Code

`name` is both the output variable name and the key into the ad's frozen
ad_attributions row, so a lookup conf without one reads nothing off the row
while presenting itself in the form as configured — a filled-in row that can
only ever yield nothing.

The guard was `variables.length === 0`, which one unnamed variable passes: its
length is 1. Filtering the names is what actually expresses the rule, and a
source whose variables are all unnamed falls back to the blank row it would
have shown anyway.

Also pins two ref_mode properties that held but were untested: a conf stating
an explicit mode keeps it through an unrelated edit, and a mode matching what
was loaded does not warn.

Found comparing the shipped implementation against feature/ref-mode-dashboard-ux
(PR #246), which built the same design independently and carries a test for
this case. Both new tests fail without the fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for vlab-dashboard ready!

Name Link
🔨 Latest commit 32369a4
🔍 Latest deploy log https://app.netlify.com/projects/vlab-dashboard/deploys/6a8f9453857b650007b5103f
😎 Deploy Preview https://deploy-preview-250--vlab-dashboard.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nandanrao
nandanrao merged commit bb8d49d into main Aug 27, 2026
9 of 13 checks passed
@nandanrao
nandanrao deleted the fix/lookup-confs-skip-unnamed-variables branch August 27, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant