Skip to content

[Bug]: Missing exported changes when batching operations #1291

Closed

Description

@BrianHung

Description

When batching an array formula along with neighboring cell values, change values for neighboring cells are not emitted in valuesUpdated or in exported changes when resuming evaluation. Note that values are correctly in hyperformula though (getSheetSerialized is correct).

That means, if we batch an array with a column formula with cells in the same row, none of the cells in the same row will be emitted.

Likewise, if we batch an array with a row formula with cells in the same col, none of the cells in the same col will be emitted.

Batching an array with multiple rows and columns works though.

import HyperFormula from "hyperformula";

const hf = HyperFormula.buildFromSheets(
  {
    Sheet1: [[""]]
  },
  {
    licenseKey: "gpl-v3",
    useArrayArithmetic: true
  }
);

hf.on("valuesUpdated", (changes) => console.log("changes", changes));

const changes = [];
hf.suspendEvaluation();
changes.push(hf.setCellContents({ sheet: 0, row: 0, col: 1 }, "4"));
changes.push(hf.setCellContents({ sheet: 0, row: 0, col: 2 }, "5"));
changes.push(hf.setCellContents({ sheet: 0, row: 0, col: 0 }, "={1;2;3}"));
hf.resumeEvaluation();

console.log("changes after evaluation", changes);

Code sandbox showing it doesnt work row for adjacent col values if array row formula.
https://codesandbox.io/s/angry-pond-tmy9fq?file=/src/hyperformulaConfig.js

Code sandbox showing it doesnt work for adjacent row values if array col formula.
https://codesandbox.io/s/bold-dawn-w8383q?file=/src/hyperformulaConfig.js

Video or screenshots

No response

Demo

https://codesandbox.io/s/angry-pond-tmy9fq?file=/src/hyperformulaConfig.js

HyperFormula version

2.4.0

Your framework

No response

Your environment

Chrome

Activity

  1. changed the title [-][Bug]: Missing Changes in `valuesUpdated` When Batching Array Formula[/-] [+][Bug]: Missing Exported Changes When Batching Array Formula[/+] on Jul 19, 2023
  2. adrianszymanski89 commented on Jul 20, 2023

    @adrianszymanski89
    Contributor

    Hi @BrianHung

    Thank you for reporting this. I also test it in various scenarios, and I can confirm your observations. I'll forward this to our HyperFormula developer for further investigation.

  3. added
    Bug
    on Jul 20, 2023
  4. BrianHung commented on Jul 31, 2023

    @BrianHung
    ContributorAuthor

    @adrianszymanski89 Think I found the bug and implemented a fix: #1294

    By the looks of it, it was a 2 year old bug where the author was refactoring code and forgot to use a new internal utility addressKey when writing new code.

  5. adrianszymanski89 commented on Jul 31, 2023

    @adrianszymanski89
    Contributor

    Hi @BrianHung

    Thank you for the fix! I'll update our developer about the PR.

  6. changed the title [-][Bug]: Missing Exported Changes When Batching Array Formula[/-] [+][Bug]: Missing exported changes when batching operations[/+] on Aug 2, 2023
  7. AMBudnik commented on Sep 14, 2023

    @AMBudnik
    Contributor

    I've tested the following demo with Hyperformula 2.5.0 and the build from release branch 2.6.0 and all of the changes are correctly logged in the new version

    Hyperformula 2.5.0
    Zrzut ekranu 2023-09-14 o 14 03 23

    Hyperformula 2.6.0
    Zrzut ekranu 2023-09-14 o 14 03 15

  8. AMBudnik commented on Sep 19, 2023

    @AMBudnik
    Contributor

    Hi @BrianHung

    We have an update here as well. I hope you'll benefit from those changes.

    ps. If you'd like to know what also changed in the version here are our release notes https://hyperformula.handsontable.com/guide/release-notes.html#_2-6-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugImpact: MediumReleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions