Home screen contact shortcut stays after the contact is deleted (and keeps the old name after a rename)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with shortcut creation in app/src/main/kotlin/org/fossify/contacts/adapters/ContactsAdapter.kt and the missing-contact handling in app/src/main/kotlin/org/fossify/contacts/activities/ViewContactActivity.kt. Trace contact save and delete flows to see where pinned shortcuts can be updated or disabled, then check existing shortcut related tests. Done means a renamed contact's shortcut shows the new name and a deleted contact's shortcut no longer opens an empty screen.
由索引模型根据 Issue 内容生成。
描述
Checklist
- I can reproduce the bug with the latest version given here.
- I made sure that there are no existing issues - open or closed - to which I could contribute my information.
- I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
- I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
- I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
- This issue contains only one bug.
- I have read and understood the contribution guidelines.
Affected app version
1.6.0
Affected Android/Custom ROM version
android 16
Affected device model
Xiaomi 17 promax
How did you install the app?
F-Droid / IzzyOnDroid
Steps to reproduce the bug
- Create a contact
Bob. In the contact list, long-pressBob→ ⋮ → Create shortcut → Add automatically. ABobshortcut appears on the home screen. - In Contacts, open
Bob→ Edit, rename him toRobertand save. - Go to the home screen: the shortcut is still called
Bob. Tapping it opensRobertcorrectly. - Delete
Robertin Contacts (trash icon → Yes). The contact list no longer has him. - Go to the home screen and tap the
Bobshortcut again.
Expected behavior
Both changes are made in Contacts itself, which also created the shortcut, so the app knows about them:
- after the delete (step 4), the shortcut is disabled or removed (Android then shows a "contact was deleted"-style message instead of opening it);
- after the rename (step 2), the shortcut label is updated to
Robert.
Actual behavior
After the delete, the Bob shortcut stays on the home screen. Tapping it opens an empty contact screen, which closes right away and returns to the launcher, without any message.
After the rename, the shortcut keeps the old label Bob (it still opens the right contact).
Screenshots/Screen recordings
No response
Additional information
The shortcut is created with the contact name at that time as label and contact.hashCode() as its id:
https://github.com/FossifyOrg/Contacts/blob/8bbc84014f776b2199136a500799c21425ff0fe8/app/src/main/kotlin/org/fossify/contacts/adapters/ContactsAdapter.kt#L317-L338
Nothing in the app calls ShortcutManager.updateShortcuts() or disableShortcuts(), so saving an edit or deleting a contact never touches the pinned shortcut. Because Contact is a data class, its hashCode() changes when the contact is edited, so the app could not find the shortcut again even if it tried. When the contact is gone, ViewContactActivity just finishes (the "unknown error" toast did not show up for me):
https://github.com/FossifyOrg/Contacts/blob/8bbc84014f776b2199136a500799c21425ff0fe8/app/src/main/kotlin/org/fossify/contacts/activities/ViewContactActivity.kt#L166-L175
Possible fix: use a stable shortcut id (e.g. the contact id), then call updateShortcuts() after saving and disableShortcuts(ids, message) after deleting a contact.
- 主要语言
- Kotlin
- 星标
- 917
- 派生
- 73
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
FossifyOrg/Contacts 的其他 Issue
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 78/100
FossifyOrg/Contacts#632 ·
维护者通常 1 天内回复
-
feature request needs triage
难度 1/5 1 小时以内 新手友好度 72/100
FossifyOrg/Contacts#176 · 1 条评论 ·
维护者通常 1 天内回复
-
bug needs triage
难度 3/5 1-2 天 新手友好度 65/100
FossifyOrg/Contacts#630 ·
维护者通常 1 天内回复
-
bug needs triage
难度 3/5 1-2 天 新手友好度 64/100
FossifyOrg/Contacts#618 ·
维护者通常 1 天内回复
-
feature request needs triage
难度 3/5 1-2 天 新手友好度 65/100
FossifyOrg/Contacts#614 · 1 条评论 ·
维护者通常 1 天内回复
查看 FossifyOrg/Contacts 的全部 Issue
相似的 Issue
-
needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
home-assistant/android#7690 ·
维护者通常 1 天内回复
-
staticAssetsPath follows symlinks outside the directory on Windows可能已有人在做 @ybelMekk 今天认领。 未关闭bug security findings
难度 2/5 1-3 小时 新手友好度 84/100
navikt/mock-oauth2-server#1132 ·
维护者通常 1 天内回复
-
performance solver
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
a:plugin-description
难度 1/5 1 小时以内 新手友好度 76/100
gradle/plugin-portal-requests#319 ·