Skip to content

engine error with addColumns+removeColumns+undo #502

Closed

Description

@izulin

Description

Following code:

const engine = HyperFormula.buildFromArray([])
engine.setCellContents({sheet: 0, col: 13, row: 2}, '=SUM(A2:H3)')
engine.addColumns(0, [10,2])
engine.removeColumns(0, [0,1])
engine.undo()

results in:

Error: There is no AST with such key in the cache
at ParserWithCaching.fetchCachedResult (/Users/przemek/navalgo/HyperFormula/src/parser/ParserWithCaching.ts:108:13)

Steps to reproduce

Demo

Your environment

  • HyperFormula version:
  • Browser Name and version:
  • Operating System:

Links

Activity

  1. added
    Bug
    on Sep 3, 2020
  2. izulin commented on Sep 4, 2020

    @izulin
    ContributorAuthor

    Ok, one more error:

    const engine = HyperFormula.buildFromArray([])
        engine.setCellContents({sheet: 0, col:3, row:3}, 6)
        engine.setCellContents({sheet: 0, col: 13, row: 3}, '=SUM(G1:J5)')
        engine.setCellContents({sheet: 0, col: 9, row: 3}, '=SUM(A4:D5)')
        engine.setCellContents({sheet: 0, col: 17, row: 3}, '=SUM(F3:K5)')
        engine.setCellContents({sheet: 0, col: 21, row: 3}, '=SUM(J2:P4)')
        engine.setCellContents({sheet: 0, col: 22, row: 2}, '=SUM(K3:P4)')
        engine.addColumns(0, [2,2])
        engine.removeColumns(0, [6,1])
        engine.addColumns(0, [12,2])
        engine.removeColumns(0, [22,1])
        engine.addColumns(0, [7,2])
        engine.removeColumns(0, [10,1])
        engine.addColumns(0, [21,2])
        engine.removeColumns(0, [11,1])
        engine.undo()
        engine.redo()
        engine.addRows(0, [3,2])
        engine.removeRows(0, [1,1])
        engine.moveCells( {sheet: 0, col: 11, row: 2}, 6, 6, {sheet: 0, col: 1000, row: 1000})
        engine.moveCells( {sheet: 0, col: 22, row: 2}, 6, 6, {sheet: 0, col: 11, row: 2})
        engine.moveCells( {sheet: 0, col: 1000, row: 1000}, 6, 6, {sheet: 0, col: 22, row: 2})
        engine.undo()
    
    Error: Value of the formula cell is not computed.
    
  3. izulin commented on Nov 4, 2020

    @izulin
    ContributorAuthor

    seems to be fixed by #563

  4. voodoo11 commented on Nov 4, 2020

    @voodoo11
    Contributor

    seems to be fixed by #563

    👏

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

Metadata

Metadata

Labels

BugVerified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions