Skip to content

[filters] Match empty metadata values - #2194

Merged
NicoPennec merged 3 commits into
cgwire:mainfrom
ivancea:fix/empty-metadata-string-filter
Sep 3, 2026
Merged

[filters] Match empty metadata values#2194
NicoPennec merged 3 commits into
cgwire:mainfrom
ivancea:fix/empty-metadata-string-filter

Conversation

@ivancea

@ivancea ivancea commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Problem

  • Filters such as [Invoice]=[] cannot find assets with blank metadata.
  • Blank metadata can be stored as a missing key, null, an empty string, or an empty tag list.

Solution

  • Match each datatype's blank representation when filtering with [].
  • Keep non-empty metadata filters unchanged.
  • This cannot distinguish never-set from cleared metadata because both appear as blank values in Kitsu.

Comment thread src/lib/filtering.js Outdated
@NicoPennec

Copy link
Copy Markdown
Member

Thanks @ivancea! This looks good to me overall.

The only thing I would change is the number case:
[Budget]=[] still misses cleared number metadata, since '' skips the new missing/null branch and parseFloat('') is NaN, so normalizing blank once before the data_type dispatch would cover every type.

@ivancea
ivancea requested a review from NicoPennec September 3, 2026 09:46
@NicoPennec
NicoPennec merged commit 9479277 into cgwire:main Sep 3, 2026
5 checks passed
@ivancea
ivancea deleted the fix/empty-metadata-string-filter branch September 3, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants