mapbox / mapbox/mapbox-gl-js

Mapbox Studio Filter Expression triggering high memory usage and slower framerate.

Open
#13,339 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The below filter expression is triggering a warning saying:

```
Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
and paste the contents of this message in the report.
```

I'm doing my part! 🫡

```
Filter Expression:
[
"all",
[
">",
[
"get",
"way_area"
],
150000
],
[
"any",
[
"!",
[
"in",
"park",
[
"downcase",
[
"case",
[
"==",
[
"get",
"name"
],
null
],
"",
[
"get",
"name"
]
]
]
]
],
[
"!",
[
"in",
"park",
[
"downcase",
[
"case",
[
"==",
[
"get",
"name"
],
null
],
"",
[
"get",
"name"
]
]
]
]
]
],
[
"case",
[
"<=",
[
"pitch"
],
45
],
true,
[
"<=",
[
"distance-from-center"
],
2
]
]
]Filter Expression:
[
"all",
[
">",
[
"get",
"way_area"
],
150000
],
[
"any",
[
"!",
[
"in",
"park",
[
"downcase",
[
"case",
[
"==",
[
"get",
"name"
],
null
],
"",
[
"get",
"name"
]
]
]
]
],
[
"!",
[
"in",
"park",
[
"downcase",
[
"case",
[
"==",
[
"get",
"name"
],
null
],
"",
[
"get",
"name"
]
]
]
]
]
],
[
"case",
[
"<=",
[
"pitch"
],
45
],
true,
[
"<=",
[
"distance-from-center"
],
2
]
]
]
```

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

The issue names no repository file, test, or entry point. Start by reproducing the supplied filter expression and tracing the source of the “Failed to extract static filter” warning. Done means identifying the expression path responsible for the warning and verifying the resulting memory and framerate behavior after a fix.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.