GitHub #36 luma-search: one uninstalled Settings panel or app stops the service (PyGObject raises TypeError, not None)
Summaryluma-search-service is meant to skip Settings pages, Filer places and Depot results whose desktop app is not installed (Gio.DesktopAppInfo.new(x) is None). With PyGObject on Fedora 44, Gio.DesktopAppInfo.new() raises TypeError: constructor returned NULL for an unknown desktop ID instead of returning None, so those checks never see a missing app and the exception escapes.
Effect
- A single panel listed in
src/luma-search/settings-pages.jsonthat is not installed makes_load_settings_pages()raise at startup, so the D-Bus activation fails (NameHasNoOwner … unit failed) and search is unavailable everywhere. - With that fixed, a missing Filer (
org.gnome.Nautilus.desktop) makes everySearch1.Queryfail withQueryFailed: constructor returned NULL(from_places()), and a missing Depot does the same for Depot actions (luma_search/depot.py).
Reproduce (Fedora 44 aarch64, luma-search built from main 4a736ac, stock gnome-control-center without the dash panel, no Filer/Depot):
gdbus call --session --dest org.projectluma.Search --object-path /org/projectluma/Search \
--method org.projectluma.Search1.Query "Messages" 1 8
Journal: File "/usr/libexec/luma-search-service", line 352 … Gio.DesktopAppInfo.new(f"gnome-{page['panel']}-panel.desktop") … TypeError: constructor returned NULL.
On a full Luma image (Luma's g-c-c, Filer, Depot) this may not trigger today, but any missing or renamed panel/app takes all of search down.
Suggested fix
A helper that maps the TypeError to None, used at all seven call sites (luma-search-service lines ~176, 347, 391, 539, 561, 568 and luma_search/depot.py:86):
def desktop_app_info(desktop_id):
if not desktop_id:
return None
from gi.repository import Gio
try:
return Gio.DesktopAppInfo.new(desktop_id)
except TypeError:
return None
We have this with four regression tests (missing panel/app skipped at load, _places() without Filer returns [], Depot action without Depot raises ValueError('Depot is unavailable'), real binding on an unknown ID); all four fail before the change and pass after. tests/unit/test_luma_search.py and tests/search still pass. Happy to open a PR.
Found while building Luma from source on a Fedora 44 aarch64 VM (Luma's FP6 twin setup).