Repository navigation
fix(desktop): honor hidden application overrides during ID lookup - #12675
Conversation
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryID lookup now honors hidden Application overrides without changing direct-file inspection.
No actionable issues found. Runtime tests were not run during this review. Whether another PR supersedes this one could not be checked because GitHub access required authentication. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Desktop entry selector] --> B{Absolute path?}
B -->|Yes| C[Read selected file]
B -->|No| D[Find candidate in next data directory]
D --> E[Read candidate]
E --> F{Hidden?}
F -->|No| G[Check Application type and Exec]
F -->|Yes| H{Application type?}
H -->|Yes| I[Return not found]
H -->|No| D
C --> G
G --> J[Build launch command]
E -->|Read fails| K[Return refusal]
Reviews (3) · Last reviewed commit: "test(desktop): preserve refusal details ..." · Reviewed by Greptile |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Problem and outcome
A user can remove a desktop application by installing a higher-priority entry with the same ID and
Hidden=true. Looking up that ID with GIO returns no application. At04b47507d, REA still returned the user's launch command. A hidden Application entry without an Exec field instead produced an invalid-entry error.Read the selected entry while walking the data directories. A hidden Application masks its ID. A hidden file without an Application type lets the search continue. An absolute path selects the file directly. NoDisplay continues to affect menu visibility independently of ID lookup.
Fixes #12671.
Evidence and validation
The native reference was
g_desktop_app_info_newfrom GLib/GIO 2.88.0 with two temporary XDG data roots, a lower system entry and controlled user overrides. A complete hidden application's ID was absent, whileg_desktop_app_info_new_from_filenamecould still read it. NoDisplay=true and Hidden=false returned the user copy. A file containing only a Desktop Entry group and Hidden=true fell back to the system copy.Three ID-lookup cases failed on the original implementation and both nearby controls passed. The final tests also check explicit-file error details, the public output keys and a refused read above a valid system copy. After the change, five suites passed 240/240 on Linux. Three domain suites passed 100/100 on Windows. These cover inventory, desktop fields and export consumers. Nine of eleven single-line mutations were caught by the runtime tests. Deleting a TypeScript field declaration or the existing cancellation recheck immediately after a nested search did not change these fixture results. The reviewed head was
94cf053f3. Node.js 24.22.1 and Vitest 5.0.3. The full static check passed on Windows with npm 11.19.1. The full repository test suite was not run for this head.node node_modules/vitest/vitest.mjs run --coverage.enabled=false --maxWorkers=1 src/desktop/LinuxApplicationInventory.test.ts -t 'resolves the user override|without an Application type' node node_modules/vitest/vitest.mjs run --coverage.enabled=false --maxWorkers=1 src/desktop/LinuxApplicationInventory.test.ts src/domain/desktop/desktopEntry.test.ts src/domain/desktop/desktopEntryValues.test.ts src/domain/desktop/appExportInstall.test.ts src/application/desktop/DesktopApplicationExport.test.ts npm run checkChange and scope
The internal parser reads Hidden using the desktop boolean rules it already applies to Terminal. The capture output keeps its existing fields.
Contract and boundary impact
An ID masked by a hidden application gets the existing desktop_entry_not_found refusal. Direct file inspection still checks that the file is an Application entry with an Exec field. The path search keeps its existing read limits, cancellation and incomplete-search refusal.
Compatibility, safety, and release
Validation used local desktop entries. Querying those entries required no application launch. The fixtures use available executables. Checks of executable availability performed by a desktop environment are outside this change.
Desktop Entry Specification, recognized keys
Author readiness
Human owner: @Plastic-time
Before merge
type(scope): outcome.