Repository navigation
fix: remove endsWith(.desktop) heuristic in normalizedDesktopId - #823
Merged
Merged
Conversation
1. Root cause: normalizedDesktopId() used endsWith(".desktop") to
skip appending the suffix, but AM DBus appId always lacks the
.desktop extension; for org.telegram.desktop the check returned
true, so GIO got org.telegram.desktop instead of
org.telegram.desktop.desktop and returned NULL
2. Fix: remove the endsWith(".desktop") condition; always append
.desktop unless the source is empty or starts with internal/
3. Impact: apps whose appId ends with .desktop (e.g. Telegram linyaps)
can now be uninstalled, launched, and docked correctly; no
regression for normal apps or BUG-378253 fix
Log: Fixed linyaps apps with .desktop suffix in app ID cannot be uninstalled from launcher
Influence:
1. Test uninstalling linyaps apps with .desktop suffix in app ID
2. Test launching linyaps apps with .desktop suffix in app ID
3. Test dock operations for linyaps apps with .desktop suffix
4. Test normal apps without .desktop suffix still work correctly
fix: 移除 normalizedDesktopId 中的 endsWith(.desktop) 启发式判断
1. 根因:normalizedDesktopId() 使用 endsWith(".desktop") 跳过后缀
追加,但 AM DBus appId 始终不含 .desktop 后缀;对
org.telegram.desktop 该判断返回 true,导致 GIO 收到
org.telegram.desktop 而非 org.telegram.desktop.desktop,返回 NULL
2. 方案:移除 endsWith(".desktop") 条件,仅在 source 为空或以
internal/ 开头时跳过后缀追加
3. 影响:appId 以 .desktop 结尾的玲珑应用(如 Telegram)可正常
卸载、启动和驻留;对普通应用及 BUG-378253 修复无回归
Log: 修复玲珑应用 appId 含 .desktop 后缀时启动器无法卸载的问题
Influence:
1. 测试 appId 含 .desktop 后缀的玲珑应用卸载功能
2. 测试 appId 含 .desktop 后缀的玲珑应用启动功能
3. 测试 appId 含 .desktop 后缀的玲珑应用驻留操作
4. 测试不含 .desktop 后缀的普通应用功能无回归
PMS: BUG-379545
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves the endsWith(".desktop") heuristic so AM-provided app IDs are consistently normalized for GIO lookups, fixing launch, uninstall, and dock operations for IDs such as org.telegram.desktop while updating related tests to match the suffix-free appId contract. Sequence diagram for corrected desktop ID normalizationsequenceDiagram
participant Caller
participant AppsModel
participant GIO
Caller->>AppsModel: indexFromDesktopId(appId)
AppsModel->>AppsModel: normalizedDesktopId(sourceId)
Note over AppsModel: org.telegram.desktop becomes org.telegram.desktop.desktop
AppsModel->>GIO: g_desktop_app_info_new(desktopId)
GIO-->>AppsModel: Desktop app info
AppsModel-->>Caller: Valid app lookup
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
18202781743
approved these changes
Oct 15, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause Analysis
AppsModel::normalizedDesktopId()usedendsWith(".desktop")as a heuristic to skip appending the.desktopsuffix. However, the AM DBus always provides appId (the desktop filename without.desktopextension), so fororg.telegram.desktopthe heuristic returned true and skipped the suffix append. This producedorg.telegram.desktopinstead oforg.telegram.desktop.desktop, causingg_desktop_app_info_new()to return NULL. All downstream operations (uninstall, launch, dock) received an empty path and failed silently.Fix
Removed the
endsWith(".desktop")condition fromnormalizedDesktopId(). The function now always appends.desktopunless the source is empty or starts withinternal/. This aligns with the AM DBus contract: appId is always the desktop filename without the.desktopextension.Change Safety Assessment
Code Safety
endsWith(".desktop")check was introduced by commit322366a(PMS BUG-378253). Removing it does not revert BUG-378253's fix becausedata(DesktopIdRole)still returns raw source data without going throughnormalizedDesktopId(). The normalization function is only used internally byindexFromDesktopId()for GIO lookups.Business Impact Scope
Affected functional modules:
.desktopsuffix in appId can now be correctly uninstallednormalizedDesktopId()pathVerification Suggestion
Test uninstalling, launching, and docking linyaps Telegram (org.telegram.desktop). Regression-test normal apps without
.desktopsuffix in appId.根因分析
AppsModel::normalizedDesktopId()使用endsWith(".desktop")启发式判断跳过后缀追加。但 AM DBus 提供的 appId 始终是桌面文件名去掉.desktop后缀的结果,对org.telegram.desktop该判断返回 true 导致不追加后缀,生成org.telegram.desktop而非org.telegram.desktop.desktop,g_desktop_app_info_new()返回 NULL,下游卸载/启动/驻留操作全链路静默失败。修复方案
移除
normalizedDesktopId()中的endsWith(".desktop")条件,仅在 source 为空或以internal/开头时跳过后缀追加。这与 AM DBus 契约一致:appId 始终是不含.desktop后缀的桌面文件名。改动安全评估
代码安全评估
endsWith(".desktop")检查由 commit322366a(PMS BUG-378253)引入。移除该检查不会回退 BUG-378253 的修复,因为data(DesktopIdRole)仍返回原始 source data,不经过normalizedDesktopId()。该归一化函数仅被indexFromDesktopId()内部用于 GIO 查找。业务影响范围
受影响功能模块:
.desktop后缀的玲珑应用现在可以正确卸载normalizedDesktopId()路径验证建议
测试玲珑版 Telegram(org.telegram.desktop)的卸载、启动、驻留操作。回归测试不含
.desktop后缀的普通应用功能。Summary by Sourcery
Correct desktop ID normalization to consistently resolve application IDs according to the AM DBus contract.
Bug Fixes:
Tests: