Formula cells (typed, pasted, autofilled, or applied via "Apply as formula") were submitting their raw =... text to the backend instead of the value HyperFormula actually displays — affecting character columns, numeric columns, and primary key columns, each with its own failure mode.
Intent
Formulas are enabled on every column, but the grid's underlying dataSource never mutates when HyperFormula recalculates a cell's displayed value — it only updates the render layer. saveTable() originally resolved computed values only for HARDFORMULA/SOFTFORMULA columns, so any other live formula reached the backend as literal text, which a SAS field (especially a numeric one) can't parse.
A primary key needed different treatment again: PK values drive row identity throughout the edit session (dataModified/classifyRow match a row by comparing its PK). Resolving a PK's formula only at submit time meant its value could differ from whatever dataModified snapshotted earlier, silently dropping the row from submission. This applies whether the formula was user-entered or seeded by a HARDFORMULA/SOFTFORMULA rule assigned directly to a PK column — nothing prevents that assignment, and a rule-seeded PK formula is present from the very first render, not just after an edit.
Changes
saveTable() now resolves any live =-led cell to its computed value before submission, for every column (not just HARDFORMULA/SOFTFORMULA ones).
coerceNumericRow (beforePaste/beforeAutofill) no longer lets a numeric column's raw formula text bypass resolution.
A new afterChange hook resolves a primary key's formula to its computed value immediately, the moment the edit completes (typed, pasted, autofilled, or "Apply as formula"'d) — a PK is never left holding a live, still-recalculating formula.
A new resolvePkFormulaSeedValues() freezes a HARDFORMULA/SOFTFORMULA-driven PK to its computed value once, right after the initial table load, mirroring the same value onto dataSourceUnchanged so row-identity matching stays consistent.
Mock server: added MPE_X_FORMULA_PK_TEST, a dedicated table with a composite PK made of a HARDFORMULA numeric column and a SOFTFORMULA character column, for exercising the rule-seeded PK case end-to-end.
Karma: added integration coverage (real Handsontable + HyperFormula instances) for character, numeric, and PK columns, both user-entered and rule-seeded formulas.
Cypress: added tests 49–52 covering formula submission in a character column, a numeric column, a user-entered PK formula, and a HARDFORMULA/SOFTFORMULA composite PK.
## Summary
Formula cells (typed, pasted, autofilled, or applied via "Apply as formula") were submitting their raw `=...` text to the backend instead of the value HyperFormula actually displays — affecting character columns, numeric columns, and primary key columns, each with its own failure mode.
## Intent
Formulas are enabled on every column, but the grid's underlying `dataSource` never mutates when HyperFormula recalculates a cell's displayed value — it only updates the render layer. `saveTable()` originally resolved computed values only for HARDFORMULA/SOFTFORMULA columns, so any other live formula reached the backend as literal text, which a SAS field (especially a numeric one) can't parse.
A primary key needed different treatment again: PK values drive row identity throughout the edit session (`dataModified`/`classifyRow` match a row by comparing its PK). Resolving a PK's formula only at submit time meant its value could differ from whatever `dataModified` snapshotted earlier, silently dropping the row from submission. This applies whether the formula was user-entered or seeded by a HARDFORMULA/SOFTFORMULA rule assigned directly to a PK column — nothing prevents that assignment, and a rule-seeded PK formula is present from the very first render, not just after an edit.
## Changes
- `saveTable()` now resolves any live `=`-led cell to its computed value before submission, for every column (not just HARDFORMULA/SOFTFORMULA ones).
- `coerceNumericRow` (`beforePaste`/`beforeAutofill`) no longer lets a numeric column's raw formula text bypass resolution.
- A new `afterChange` hook resolves a primary key's formula to its computed value immediately, the moment the edit completes (typed, pasted, autofilled, or "Apply as formula"'d) — a PK is never left holding a live, still-recalculating formula.
- A new `resolvePkFormulaSeedValues()` freezes a HARDFORMULA/SOFTFORMULA-driven PK to its computed value once, right after the initial table load, mirroring the same value onto `dataSourceUnchanged` so row-identity matching stays consistent.
- Mock server: added `MPE_X_FORMULA_PK_TEST`, a dedicated table with a composite PK made of a HARDFORMULA numeric column and a SOFTFORMULA character column, for exercising the rule-seeded PK case end-to-end.
- Karma: added integration coverage (real Handsontable + HyperFormula instances) for character, numeric, and PK columns, both user-entered and rule-seeded formulas.
- Cypress: added tests 49–52 covering formula submission in a character column, a numeric column, a user-entered PK formula, and a HARDFORMULA/SOFTFORMULA composite PK.
saveTable() only resolved computed values for HARDFORMULA/SOFTFORMULA
columns - a formula typed, pasted, or "Apply as formula"'d into any
other character column still had its raw `=...` text submitted,
since HyperFormula recomputes the display without ever mutating the
underlying dataSource string.
saveTable() only resolved a live formula's computed value for character columns - coerceNumericRow (beforePaste/beforeAutofill) deliberately leaves a non-numeric, formula-looking value alone rather than forcing it to NaN, so a numeric column can hold a live formula too. Its raw `=...` text was reaching the backend, which a numeric SAS field can't parse.
Writing back an unescaped cell's value unconditionally materialized a column the backend never populated as an explicit `undefined`, which the SASjs adapter rejects at submit time. dynamicCellValidation's column-name lookup (Object.keys(row)[column]) only worked by coincidence when every row had a full key set - fixed to use hot.colToProp instead.
- Accept a single pasted/uploaded combined licence key (base64+gzip of
licence+activation key), auto-detected in either paste mode, alongside
the legacy two-field format
- Warn and block applying a key generated for the wrong protocol before
it ever reaches the backend
- Decode both the legacy positional features string and a new named
features object, so already-issued keys keep working unchanged
- Show a live "Key Details" preview (validity, users, site IDs, enabled
features) as a key is typed, pasted, or uploaded
- Fix cypress test setup broken by the paste-format default change, and
an unreliable FileReader-based base64 conversion in the test helpers
- Tests 7-10 only acted when already on the licensing page, silently
no-oping otherwise; now they navigate to licensing/update explicitly
when needed, chained via .then() to avoid Cypress conflating a raw
async function's promise with the preceding cy.visit()/cy.wait()
- Replace Response(readable).arrayBuffer() with a direct
ReadableStream reader loop in generateCombinedKey - the Response-based
read never settled under Cypress, likely due to its fetch/Response
patching for network interception
- licensing.cy.ts: call proceed() unconditionally via cy.then() instead of conditionally chaining .then() after cy.wait(), so the command queue stays open across the async gap and enqueued commands always run
- combinedLicenceKey.ts: replace new Response(stream).arrayBuffer() with an explicit streamToArrayBuffer helper for broader browser support
- remove debug-license.cy.ts, an untracked throwaway repro for the promise-handling question
- editor.cy.ts: assert DC.USER_NAME is non-empty instead of hardcoded
'sasdemo' (CI runs as a different OS user)
- editor.cy.ts: use =SOME_BESTNUM * 0 + 1936 for a deterministic formula
result regardless of the column's actual value
- excel.cy.ts: expect computed value '2' instead of formula text '=1+1'
(no XL_RULE=FORMULA configured on that column)
- excel-multi-load.cy.ts: use DC996664 libref to match the actual fixture
sheet names
- makedata.js: add labels to DC_JSLIB.MPE_X_TEST schema (SOME_CHAR,
SOME_DATE, SOME_DATETIME, SOME_TIME) for the viewer-labels tests
- makedata.js: register DC996664 libref with MPE_X_TEST/MPE_TABLES/
MPE_VALIDATIONS/MPE_ALERTS and copy table files for multi-load fixtures
- makedata.js: change SOME_SHORTNUM HARDREGEX from [1-5] to [0-2]
- loadfile.js: exclude VAR_TXFROM/VAR_TXTO/VAR_PROCESSED columns from the
missing-cols check for TXTEMPORAL tables (computed at load time)
- InfoModal.ts: add _PROGRAM to AbortDetails
- info-modal.component.html: display _PROGRAM in the abort modal
- 4 call sites: pass abortRes._PROGRAM when building AbortDetails
The multi-load fixture sheets for DC996664.MPE_VALIDATIONS had data
misaligned with the schema, corrupting the shared submit state. The
tests only need MPE_X_TEST and MPE_TABLES, so only register those two.
rejection.js defined its own local saveTableData(tableName, tableData)
with 2 args, but dcMockUtils.js (loaded via eval) also defines
saveTableData(dataDir, tableName, tableData) with 3 args. The
dcMockUtils version was shadowing the local one, causing
saveTableData('MPE_SUBMIT', submitData) to pass the table name as
dataDir and the data object as tableName, crashing with
'TypeError: tableName.toLowerCase is not a function'.
Removed the local saveTableData and updated calls to use the
dcMockUtils 3-arg signature: saveTableData(dataDir, tableName, data).
Same shadowing issue as rejection.js: postdata.js defined its own
saveTableData(tableName, tableData, tableLibref) which was shadowed
by dcMockUtils.saveTableData(dataDir, tableName, tableData) from the
eval. Renamed to saveTableToLib to eliminate the collision.
The Excel fixture files (7th_tab, extra_column, duplicate_column,
duplicate_row, regular_xls, regular_with_delete, password, leading
whitespace) contain SOME_SHORTNUM values of 0, 1, and 2. The
HARDREGEX /^(??$).*/ blocks those values, aborting
the upload before it reaches the submit/approve flow. Removing the
rule allows all 23 excel.cy.ts tests and both liveness.cy.ts tests
to pass.
startupservice.js only returned LIBREF in saslibs, but the dc-tree
component renders LIBRARYNAME — without it the nav tree node text was
empty, so libraryToOpenIncludes could not match. Added LIBRARYNAME,
LIBRARYID, and ENGINE to match the viewlibs service format.
Changed libraryToOpenIncludes_SASJS from 'dc' to 'dc_jslib' to avoid
matching multiple libraries (DC_JSLIB and DC996664 both contain 'dc').
viewdata.js: removed alphabetical .sort() on cols (SAS preserves
physical column order via mp_getcols); added empty row with correct
SAS missing values ('.' for numeric, '' for character) when a table
has no data, so the viewbox grid can derive column headers.
viewdata.js hardcoded PK_FIELDS as empty, so the viewbox grid treated
all columns as non-PK. removeAllColumns() could delete every column
including the ones the tests expect to be protected.
Now reads MPE_TABLES buskey (mirrors mp_getpk) and falls back to
LOAD_REF LIBREF DSN KEY_HASH TGTVAR_NM for MPE_AUDIT (which has a
known index-based PK in real SAS but isn't registered in MPE_TABLES).
All 12 viewbox.cy.ts tests now pass.
stage.cy.ts navigates directly to /stage/DC20221007T122326121_612316_7259
and expects a hot table with MPE_X_TEST data. The mock had no fixture
staged.json or MPE_SUBMIT row for this table ID, so getstagetable
returned 0 rows and getchangeinfo returned empty jsparams.
Added a fixture staged.json with MPE_X_TEST rows (SOME_DATE=42) and
a matching MPE_SUBMIT row (SUBMITTED status) in makedata.js.
getchangeinfo.js: use SAS datetime19. format (DDMMMYYYY:HH:MM:SS)
for SUBMITTED_ON_DTTM and REVIEWED_ON_DTTM, matching the real SAS
output. Use SUBMIT_STATUS_CD field name (not REVIEW_STATUS_ID)
to match the MPE_SUBMIT column name and getchangeinfo.sas output.
stage.cy.ts: add login step in beforeEach (the beforeAll logs out
after uploading the license, so each test needs to re-login).
Use loginAndUpdateValidKey(true) to force license upload.
The stage.cy.ts fixture had 7 rows of MPE_X_TEST data with wide string
values, causing Handsontable to auto-size columns wider so only 4 of
10 fit in the 1280px viewport. The test checks .ht_clone_top headers
which only render visible columns.
Limited to 1 row (matching the original sas9 mock) and moved
_____DELETE__THIS__RECORD_____ to the end of the column order.
Rewrite stage.cy.ts to follow the same pattern as excel.cy.ts:
open MPE_X_TEST, attach regular_excel.xlsx, submit to create staged
data, then test the formatted/unformatted toggle on the stage page.
The date assertion is now dynamic: reads the raw SOME_DATE value
from the unformatted view and computes the expected SAS date9.
formatted value, rather than hardcoding 12FEB1960.
Remove the fixture stageSubmission code from makedata.js — staged
data is created at runtime by stagedata.js, not by makedata.
allan
merged commit 25434b35b9 into version7-132026-08-30 22:00:07 +00:00
allan
deleted branch process-formula2026-08-30 22:00:07 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Formula cells (typed, pasted, autofilled, or applied via "Apply as formula") were submitting their raw
=...text to the backend instead of the value HyperFormula actually displays — affecting character columns, numeric columns, and primary key columns, each with its own failure mode.Intent
Formulas are enabled on every column, but the grid's underlying
dataSourcenever mutates when HyperFormula recalculates a cell's displayed value — it only updates the render layer.saveTable()originally resolved computed values only for HARDFORMULA/SOFTFORMULA columns, so any other live formula reached the backend as literal text, which a SAS field (especially a numeric one) can't parse.A primary key needed different treatment again: PK values drive row identity throughout the edit session (
dataModified/classifyRowmatch a row by comparing its PK). Resolving a PK's formula only at submit time meant its value could differ from whateverdataModifiedsnapshotted earlier, silently dropping the row from submission. This applies whether the formula was user-entered or seeded by a HARDFORMULA/SOFTFORMULA rule assigned directly to a PK column — nothing prevents that assignment, and a rule-seeded PK formula is present from the very first render, not just after an edit.Changes
saveTable()now resolves any live=-led cell to its computed value before submission, for every column (not just HARDFORMULA/SOFTFORMULA ones).coerceNumericRow(beforePaste/beforeAutofill) no longer lets a numeric column's raw formula text bypass resolution.afterChangehook resolves a primary key's formula to its computed value immediately, the moment the edit completes (typed, pasted, autofilled, or "Apply as formula"'d) — a PK is never left holding a live, still-recalculating formula.resolvePkFormulaSeedValues()freezes a HARDFORMULA/SOFTFORMULA-driven PK to its computed value once, right after the initial table load, mirroring the same value ontodataSourceUnchangedso row-identity matching stays consistent.MPE_X_FORMULA_PK_TEST, a dedicated table with a composite PK made of a HARDFORMULA numeric column and a SOFTFORMULA character column, for exercising the rule-seeded PK case end-to-end.Code Review
Verdict: Approve — no changes needed.
Reviewed by Hermes Agent
Test Coverage
Services: 22/60 (37%) | Macros: 12/42 (29%) | Overall: 34/102 (33%) —
2026-08-25T15:38:18Zonb7d31066aePR diff
Generated by Hermes Agent
rejection.js defined its own local saveTableData(tableName, tableData) with 2 args, but dcMockUtils.js (loaded via eval) also defines saveTableData(dataDir, tableName, tableData) with 3 args. The dcMockUtils version was shadowing the local one, causing saveTableData('MPE_SUBMIT', submitData) to pass the table name as dataDir and the data object as tableName, crashing with 'TypeError: tableName.toLowerCase is not a function'. Removed the local saveTableData and updated calls to use the dcMockUtils 3-arg signature: saveTableData(dataDir, tableName, data).startupservice.js only returned LIBREF in saslibs, but the dc-tree component renders LIBRARYNAME — without it the nav tree node text was empty, so libraryToOpenIncludes could not match. Added LIBRARYNAME, LIBRARYID, and ENGINE to match the viewlibs service format. Changed libraryToOpenIncludes_SASJS from 'dc' to 'dc_jslib' to avoid matching multiple libraries (DC_JSLIB and DC996664 both contain 'dc'). viewdata.js: removed alphabetical .sort() on cols (SAS preserves physical column order via mp_getcols); added empty row with correct SAS missing values ('.' for numeric, '' for character) when a table has no data, so the viewbox grid can derive column headers.