Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: A locked label can attach to a new feature that reuses a deleted feature's id

Open
#1,135 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
frontend

Research direction

Start with Dataset::push in crates/data/src/lib.rs and trace how feature IDs are assigned, removed, and used in label lock entries. Compare the monotonic ID and lock pruning approaches described in the issue, and check how project serialization and undo preserve those values. Done when a newly added feature has no label while the lock is active, and LabelKey IDs remain distinct on wasm32.

Written by the indexing model from the issue text.

Description

unconfirmed possible issue
Before you start
  • I searched the existing issues and did not find a duplicate.
  • This is a bug report, not a usage question (questions belong in Discussions).
What happened?

With labels locked, a feature added after deleting the feature with the highest id shows its label, although it wasn't placed when the lock was taken.

Dataset::push gives a new feature max(id) + 1 (crates/data/src/lib.rs:340). Since #1134 a lock names each label by its feature's id, so the new feature takes the deleted one's id, matches its lock entry and is drawn there without a collision check. This isn't a regression: with row keys the new feature took the same row, so it had the same key. #1134 fixes the cases where rows move and leaves this one. Found in review of #1134.

Related: LabelKey keeps the feature id as usize, so on wasm32 (the web app) two ids that differ by a multiple of 2^32 share a key. That truncation already applied to streamed layers before #1134.

Steps to reproduce
  1. Load this CSV as XY points and label them by name. Gamma sits apart, so both labels show:
    name,x,y
    Alpha,0,0
    Gamma,10,10
    
  2. In the Labeling tab, turn on Lock.
  3. Delete Gamma (the highest id).
  4. Add a new point anywhere with the edit tools and give it a name.
  5. The new point's label shows, at the lock's place for Gamma, although it wasn't placed when the lock was taken.
Expected behavior

While labels are locked, a feature added after locking has no label, as any other new feature does; unlocking and locking again places it.

Ways to get there:

  • A monotonic next id in Dataset, so a deleted feature's id is never handed out again. This touches serialization and every reader that numbers features.
  • Or prune the lock entries of removed ids on each path that removes features (delete, cut, merge, geoprocessing updates, reloads). Undo restores the lock with the project, so it stays correct.

For the wasm32 truncation, widen the id in LabelKey to u64.

How are you running RustGIS?
  • Desktop app (downloaded release)
  • Desktop app (built from source)
  • Web app (https://web.rustgis.app)
  • Command line (rustgis-cli)
Version

0d5a23a5 (#1134)

Operating system, browser and graphics

Any (found by reading the code in review)

Dominant language
Rust
Stars
1.9k
Forks
268
Avg merge
3h 37m
Merged PRs (30d)
797

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opengeos/RustGIS

All issues in opengeos/RustGIS

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.