Skip to content

Dehydrated grid state uses incorrect column names for moved columns #643

@mattrunyon

Description

@mattrunyon

Description

The dehydrated grid state converts moved column indexes into moved column names. The idea was we would be ok if the column name order changed from the server when the workspace was applied to the table on a future load.

However, the actual dehydration algorithm does not account for moves when replacing indexes with column names.

Steps to reproduce

  1. Create a table with columns A, B, C
  2. Move A to the end (0 -> 2). Now order is B, C, A
  3. Move C to the beginning (1 -> 0). Now order is C, B, A

The moved columns array should be [{ from: 0, to: 2 }, { from: 1, to: 0 }]

Expected results

Dehydrated grid state contains moved columns [{ from: 'A', to: 'C' }, { from: 'C', to: 'B' }]

Actual results

Dehydrated grid state contains moved columns [{ from: 'A', to: 'C' }, { from: 'B', to: 'A' }]

Additional details and attachments

This will require a workspace migration to not break existing workspaces. We could just opt to keep the visible indexes which is the intended use of the moved columns. We already store a copy of the column names, so if the server had a different order, we could do some reconciliation on hydrate.

Versions

  • Deephaven: 0.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions