Skip to content

Label property edits are not deserialized #454

@PaulHax

Description

@PaulHax

Reproduce:

  1. Draw rectangle
  2. Edit label color of the rectangle
  3. Save state file
  4. Refresh and load state file
  5. Bug: Rectangle color is not your edited color, its the default.

Approach?

Bug was introduced with this code block:

// prioritize existing labels (from configJSON most likely)
.map(([id, label]) => {
return labels.findLabel(label.labelName) ?? ([id, label] as const);
})

That code will wrongly ignore property changes of deserialized labels that have the same name of default labels. To support config.JSON files over-riding session.zip files, could do a sort here:

const results = await Promise.all(
dataSources.map((r) => pipeline.execute(r, importContext))
);

Add a postResource ImportHandler that collects up config.JSONs and runs them after session.zip has been processed?

The other (more hacky) fix would be to add some state asssoated with config.JSON labels so they take priority when a tool deserialzied its labels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions