fix: memory-variable GET prefills from its stored value again#70
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) hardcodedvalue: ''instead of readingthis.vars.get(varName), so anyGETon a memory variable that already held a value — aSTORE'd default, or resubmitting a form — showed blank.This silently broke every demo that pre-fills a form default:
m_week(defaults to today's date, in both "Open/Prep Week" and "Recalculate Week"),m_date(Register Leave Taken)m_stock/m_reord/m_price(Add Product),m_qty(Stock In, Stock Out)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 whenGETruns 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
STORE "2026-07-06" TO M_WEEKthenGET M_WEEK→ asserts the form field prefills with2026-07-06, not blank. Verified it fails without the fix and passes with it.npm test— 447/447 vitest passnpm run build— clean