Skip to content

Vertex for address missing in AddressMapping when adding a row/col & then clearing the sheet #855

Closed

Description

@MartinDawson

Browser: Chrome
OS: Ubuntu 12.x
HF version: 1.3.0

Example with the error: https://codesandbox.io/s/gallant-jepsen-ix935?file=/src/index.js

Apologies for the large data set. I tried to figure out what is wrong but was unable to.

The bug only happens with chooseAddressMappingPolicy: new AlwaysSparse(). However I cannot change this in our code because we rely on AlwaysSparse (at least for now...)

If you change the addRows line to this -> hf.addRows(0, [8, 1]) then hyperformula is NOT throwing any errors. So it's only before row 8 it throws.

Reproducible error code (probably depends on the data in tableData):

import HyperFormula, { AlwaysSparse } from "hyperformula";
import { tableData } from "./data";

// Create an empty HyperFormula instance.
const hf = HyperFormula.buildFromSheets(tableData, {
  licenseKey: "gpl-v3",
  chooseAddressMappingPolicy: new AlwaysSparse()
});

hf.addRows(0, [0, 1]);

const sheetName = hf.getSheetName(0);

const sheetId = hf.getSheetId(sheetName);

hf.clearSheet(sheetId);

In my real code this bug happens after I add a row and undo on the spreadsheet.

We clear the current sheet and then set the hyperformula values again which results in the above error.

Activity

  1. added
    Bug
    on Nov 6, 2021
  2. sequba commented on Apr 26, 2022

    @sequba
    Contributor

    I am sorry you experienced an issue with HyperFormula. Our team will investigate it.

  3. warpech commented on Jun 24, 2022

    @warpech
    Member

    As part of this issue, please cross link from the API reference https://handsontable.github.io/hyperformula/api/interfaces/configparams.html#chooseaddressmappingpolicy to the Guide https://handsontable.github.io/hyperformula/guide/performance.html#address-mapping-strategies, because the API reference does not explain the point of using the configuration option chooseAddressMappingPolicy.

    (moved to #947)

  4. sequba commented on Oct 25, 2022

    @sequba
    Contributor

    Increasing impact since we received another similar bug report:

    Note: Using default chooseAddressMappingPolicy

    Error: Vertex for address missing in AddressMapping
        at AddressMapping.fetchCell (AddressMapping.js?cb8a:36:1)
        at eval (DependencyGraph.js?3bb8:73:1)
        at Array.map (<anonymous>)
        at DependencyGraph.dependencyQueryVertices [as dependencyQuery] (DependencyGraph.js?3bb8:66:1)
        at Graph.removeDependencies (Graph.js?9e87:334:1)
        at Graph.removeNode (Graph.js?9e87:148:1)
        at DependencyGraph.removeVertexAndCleanupDependencies (DependencyGraph.js?3bb8:1176:1)
        at DependencyGraph.removeVertex (DependencyGraph.js?3bb8:1157:1)
        at DependencyGraph.removeSheet (DependencyGraph.js?3bb8:384:1)
        at Operations.removeSheet (Operations.js?0eba:153:1)
    

    Details in the internal discussion: https://handsoncode.slack.com/archives/C031GBX62SE/p1666592446192099

  5. sequba commented on Nov 10, 2022

    @sequba
    Contributor

    Closing. We do not have enough information to address this issue. @MartinDawson please re-open it when you are able to provide a demo that reproduces the bug.

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: High

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions