mapbox / mapbox/mapbox-gl-js

Calling geojson.updateData multiple times in a short period of time can cause data loss

Open
#13,198 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Especially when deleting.

I have three features to be deleted;

Now I call `geojson.updateData` 3 times in a row, the second one may not be deleted.

![image](https://github.com/mapbox/mapbox-gl-js/assets/50706050/a772cc92-4467-4d0c-ac00-087ec4abb63f)

I checked the source code and found that `updateData` directly overwrites `_data`. If the previous `_updateWorkerData` is not completed, will some of the data that should be changed be lost if it is called multiple times in succession?

Contributor guide

Open the contributing guide

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.

Research direction

Start at geojson.updateData and inspect how _data is overwritten while _updateWorkerData is pending. Reproduce the three successive deletions and determine whether each update is retained; done means no feature deletion is lost when updates are called in a short sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.