Skip to content

app-filter: Fix logic for allowlist filtering on GAppInfo

Philip Withnall requested to merge allowlist-appinfo-filtering into main

Previously, the logic for combining multiple app filter checks on a GAppInfo (e.g. one for the path, one for supported content types, one for the linked flatpak, etc.) would return immediately if any of the checks blocked the app. This makes sense when the app filter is a blocklist, but when the app filter is an allowlist it’s almost always going to block every app, unless all keys of the app are explicitly allowed in the app filter.

This is probably not what people expect.

Instead, change the code to immediately return if any of the checks allow the app, when the app filter is an allowlist. The default, if all the checks for a GAppInfo don’t allow it, is to finally return blocked.

Originally reported by Mathieu Parent, see !158 (closed).

I haven’t added tests for this, because allowlist app filters are not explicitly supported: they’re not exposed in the public API or UIs, so we don’t provide regression guarantees for them. This commit doesn’t change the behaviour of blocklist app filters.

Signed-off-by: Philip Withnall pwithnall@gnome.org

Merge request reports

Loading