Skip to content

[Bug]: Reload and Repair mishandle fields whose names differ only by letter case #3560

Done

Description

@Mavrick-F

When two fields differ only by letter case, an expression or a layer setting reads the first one (#3460). Reload Data and Repair Data Source don't follow that rule when they check the replacement.

1. A query can start reading the other field.

  • A linked GeoJSON has KEEP and keep, and the layer is filtered with keep = 1, which reads KEEP.
    • Feature A: KEEP 0, keep 1
    • Feature B: KEEP 1, keep 0
  • Remove KEEP from the file, then run Reload Data, or Repair Data Source on the new file.
  • The map showed B and now shows A. The notice says the column KEEP is gone, but not that the query now reads keep.

2. A layer can be refused although its data didn't change.

  • A linked GeoJSON has KEEP (number) and keep (text), and the layer has graduated colors on KEEP.
  • Reload Data, with the file unchanged, fails: "field KEEP must remain numeric". Repair Data Source fails the same way on an identical copy.

Both checks are in compatible in crates/engine/src/cmd/repair.rs. The first only asks whether each expression still parses, and the second looks at every field with that name, ignoring case. Comparing the field each name reads before and after would fix both. Found in review of #3519.

Version: main at 0a03240, Linux.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions