You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: FORMULATEXT is not recalculated when the referenced cell's formula changes #1744
FORMULATEXT returns a stale result after the formula in the referenced cell is changed via setCellContents. The cell containing FORMULATEXT is not recalculated — even though the value of the referenced cell changed as well — and it is not included in the exported changes array.
Steps to reproduce
const{ HyperFormula }=require('hyperformula');consthf=HyperFormula.buildFromArray([[1,'=A1','=FORMULATEXT(B1)']],{licenseKey: 'gpl-v3'});hf.getSheetValues(0);// [[1, 1, '=A1']] — OK// Change the formula in B1 from =A1 to =A1+1constchanges=hf.setCellContents({sheet: 0,col: 1,row: 0},'=A1+1');console.log(changes);// [{ address: { sheet: 0, row: 0, col: 1 }, newValue: 2 }]// → only B1 is reported; C1 is missing from the changes arrayhf.getCellValue({sheet: 0,col: 2,row: 0});// actual: '=A1'// expected: '=A1+1'
Expected behavior
C1 should be recalculated and return '=A1+1', and the change to C1 should be included in the array returned by setCellContents (so that integrations consuming exported changes — e.g. the Handsontable Formulas plugin — can re-render it).
Actual behavior
C1 keeps returning the old formula text '=A1' untilthat B1's value also changed here (1 → 2), so this doesn't look like the usual "value didn't change, so dependents are skipped" optimization — the FORMULATEXT vertex simply never gets
marked for recomputation. This is possibly related tol function (doesNotNeedArgumentsToBeComputed: true), so its dependency on the referenced cell may not be registered in the dependency graph correctly.
Activity