Skip to content

fix: memory-variable GET prefills from its stored value again#70

Merged
DDecoene merged 2 commits into
release/v1.3.0from
fix/memvar-get-prefill
Jul 12, 2026
Merged

fix: memory-variable GET prefills from its stored value again#70
DDecoene merged 2 commits into
release/v1.3.0from
fix/memvar-get-prefill

Conversation

@DDecoene

Copy link
Copy Markdown
Owner

Summary

Regression found by manual testing against the running production server, right after v1.3.0 merged: doAtSayGet's variable-fallback branch (from #59's field-binding rewrite) hardcoded value: '' instead of reading this.vars.get(varName), so any GET on a memory variable that already held a value — a STORE'd default, or resubmitting a form — showed blank.

This silently broke every demo that pre-fills a form default:

  • overtime.prg: m_week (defaults to today's date, in both "Open/Prep Week" and "Recalculate Week"), m_date (Register Leave Taken)
  • INVENTORY.prg: m_stock/m_reord/m_price (Add Product), m_qty (Stock In, Stock Out)
  • crm.prg: m_val (Add Deal)

Caught by testing the running app manually, not by the test suite — every existing test for the variable-GET path used a variable with no prior value, where '' happens to be correct either way. No test ever exercised "a variable already holds a value when GET runs on it." Regression test added for that exact case; confirmed red-then-green (verified the new test fails without the fix, passes with it) before committing.

Test plan

  • New test: STORE "2026-07-06" TO M_WEEK then GET M_WEEK → asserts the form field prefills with 2026-07-06, not blank. Verified it fails without the fix and passes with it.
  • npm test — 447/447 vitest pass
  • npm run build — clean
  • Verified live against a rebuilt production server (`npm run serve`): overtime.prg's "Open/Prep Week" now shows today's date in the Week Monday field, matching the originally-reported repro exactly

DDecoene added 2 commits July 12, 2026 17:14
doAtSayGet's variable-fallback branch (introduced by #59's field-
binding rewrite) hardcoded value: '' instead of reading
this.vars.get(varName), so every GET on a variable that already held
a value (a STORE'd default, or a resubmitted form) showed blank.

Silently broke every demo that pre-fills a form default: overtime.prg
(m_week defaults to today's date in two menus, m_date in Register
Leave Taken), INVENTORY.prg (m_stock/m_reord/m_price/m_qty default to
0/0.00 in three menus), crm.prg (m_val defaults to 0.00 in Add Deal).

No test caught it because every existing var-GET test used a variable
with no prior value, where '' is the correct answer either way — the
untested surface was re-display of an existing value, not first
display of a blank one.
@DDecoene DDecoene merged commit 3e2b2e5 into release/v1.3.0 Jul 12, 2026
2 checks passed
@DDecoene DDecoene deleted the fix/memvar-get-prefill branch July 12, 2026 15:24
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