hyperformula icon indicating copy to clipboard operation
hyperformula copied to clipboard

fix(named-expressions): mark named expressions as dirty before re-computation

Open Esmail-Rahmani opened this issue 7 months ago • 1 comments

Context

It fixes an issue where named expressions were not marked as dirty after clearing dirty nodes in setCellContents, causing dependent formulas not to update correctly on subsequent value changes.

The fix ensures that all active named expressions are safely re-marked as dirty before recomputation in the recomputeIfDependencyGraphNeedsIt function.

How did you test your changes?

Manually tested by:

  • Creating named expressions and using them in formulas.
  • Updating the underlying cell values multiple times.
  • Confirming that dependent formulas are recomputed correctly after each update.
  • Validating that the behavior matches expectations across multiple updates and that no dirty state is lost.

Ran the existing unit tests to ensure no regressions were introduced.

Types of changes

  • [ ] Breaking change (a fix or a feature because of which an existing functionality doesn't work as expected anymore)
  • [ ] New feature or improvement (a non-breaking change that adds functionality)
  • [ ] Bug fix (a non-breaking change that fixes an issue)
  • [ ] Additional language file, or a change to an existing language file (translations)
  • [ ] Change to the documentation

Related issues:

  1. Fixes #1501

Checklist:

  • [x] I have reviewed the guidelines about Contributing to HyperFormula and I confirm that my code follows the code style of this project.
  • [x] I have signed the Contributor License Agreement.
  • [x] My change is compliant with the OpenDocument standard.
  • [x] My change is compatible with Microsoft Excel.
  • [x] My change is compatible with Google Sheets.
  • [ ] I described my changes in the CHANGELOG.md file.
  • [ ] My changes require a documentation update.
  • [ ] My changes require a migration guide.

Esmail-Rahmani avatar Apr 26 '25 06:04 Esmail-Rahmani

Thank you for sharing the pull request @Esmail-Rahmani

I will inform the rest of the team.

AMBudnik avatar Apr 28 '25 06:04 AMBudnik

@sequba Could you please provide an update on the progress of this task? As mentioned previously, this is a critical change for our application.

AbdulQaharRahmani avatar Jun 24 '25 05:06 AbdulQaharRahmani

@AbdulQaharRahmani We're sorry, but our capacity is currently reduced due to the holiday period. This task is scheduled for the next sprint, so we expect to give you feedback on this PR within the next two weeks.

sequba avatar Jun 25 '25 08:06 sequba

@AbdulQaharRahmani I am really sorry, we had a hectic time releasing Handsontable 16.0. I will be looking at your PR this week.

sequba avatar Jul 14 '25 11:07 sequba

@AbdulQaharRahmani, I'd prefer a different approach to fixing this issue. I'm merging your PR into a temporary branch, on which I'll adjust the solution. This change will be released with the upcoming version of HyperFormula, which is scheduled for the first half of August.

Thank you very much for your contribution. I'm sorry you had to wait so long for the feedback.

sequba avatar Jul 17 '25 08:07 sequba

Just to make a small note here for other who would like to follow the thread. We fixed the issue and updated the main thread at https://github.com/handsontable/hyperformula/issues/1501

CC @AbdulQaharRahmani

AMBudnik avatar Aug 11 '25 09:08 AMBudnik