Bug 504040 - Issue: Contact Editing Non-functional + Google Account Duplication in KAddressBook
Summary: Issue: Contact Editing Non-functional + Google Account Duplication in KAddres...
Status: REPORTED
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-11 05:10 UTC by jshand2013
Modified: 2025-05-12 20:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jshand2013 2025-05-11 05:10:27 UTC
# 🐞 Issue: Contact Editing Non-functional + Google Account Duplication in KAddressBook

## A. ❌ Cannot Edit Selected Contact

### Summary
In the current KAddressBook source build, selecting a contact and attempting to edit it results in **no UI response** — the expected contact editor dialog does not appear.

### Technical Findings
- The codebase has **no definition or invocation** of `editContact()` or equivalent methods in `MainWidget`, `MainWindow`, or related classes.
- No `QAction`, signal/slot, or context menu appears to be triggering any editing behavior.
- There is **no reference to `ContactEditor`, `ItemEditJob`, or `Akonadi::ItemEditJob`** within the available source.
- This suggests the **editing logic is either missing, disabled, or not integrated** in this version of the source.

### Possible Causes
- The editor module (e.g., `ContactEditor` or similar) may be excluded or missing from the build.
- UI logic may be incomplete or lacks connections to an editing interface.
- Contacts may be treated as read-only due to resource backend issues (e.g., LDAP, DAV, or remote Google).

### Recommendations
- Reintroduce or reconnect contact editing logic (`ContactEditor`, etc.) in the UI.
- Ensure address books are not flagged read-only unless explicitly configured that way.
- Audit UI interaction triggers (buttons, menu items) to verify they're bound to editing actions.

---

## B. 🌀 Google Account Appears Duplicated in KAddressBook

### Summary
When adding a Google account via either KAddressBook or KOrganizer, **duplicate address book entries appear** in KAddressBook.

### Behavior
- If a Google account is added from the Calendar (KOrganizer), it appears correctly.
- If the same account is then added from KAddressBook (or vice versa), it creates **a new, redundant Google address book resource**.
- The same Google contacts are then displayed multiple times, however seems that default is all ticked and displaying correctly and the duplicate has no ticks.  have not tried to verify multiple duplicate contacts

### Technical Observations
- Google account integration uses the `akonadi_google_resource`.
- There appears to be **no deduplication mechanism** to check if an account/resource already exists before creating a new one.
- The problem seems related to the **account setup workflow being duplicated** between KOrganizer and KAddressBook, each triggering independent Akonadi resource creation.

### Recommendations
- Introduce a resource check before adding a new Google Groupware resource.
- Consolidate Google account setup logic across KDE PIM apps.
- If a Google resource is already registered with Akonadi, reuse or link to it instead of creating a new instance.

---

Operating System: openSUSE Tumbleweed 20250508
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0
Kernel Version: 6.14.5-1-default (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ 7 150U
Memory: 15.3 GiB of RAM
Graphics Processor: Intel® Graphics
Manufacturer: Dell Inc.
Product Name: Inspiron 16 5640

Please advise if these issues are known, or if there is an intended workflow to avoid duplication and restore editing functionality.
Comment 1 jshand2013 2025-05-12 20:25:48 UTC
Product: Akonadi
Component: Resources
Version: (select the correct version, or “git” for latest)
Platform: openSUSE Tumbleweed (or your distribution)
OS: Linux

Title:
Duplicate Google Account Resource Initialization Occurs in Production

Description:
In both test and production environments, Akonadi appears to initialize a googleContactsResource without checking for existing instances. This leads to the unintended creation of duplicate Google account resources when using Akonadi with Google integration.

Steps to Reproduce:
Set up Akonadi with Google integration.

Add a Google account for calendar or contacts.

Observe Akonadi behavior after restart or during syncs.

Note that duplicate resources or accounts may be created, even if one already exists.

Actual Result:
Multiple googleContactsResource instances are created. There is no apparent check to prevent duplication, which leads to redundant account listings, duplicated contact syncing, and sync conflicts in some cases.

Example from source file akonadi/autotests/akonadifakedata.cpp:

cpp
Copy
Edit
AgentType googleContactsResource;
googleContactsResource.exec = QStringLiteral("akonadi_googlecontacts_resource");
googleContactsResource.mimeTypes = QStringList() << QStringLiteral("application/x-vnd.akonadi.contact");
googleContactsResource.capabilities = QStringList() << QStringLiteral("Resource") << QStringLiteral("Autostart");
This pattern appears unguarded in both test and runtime behaviors.

Expected Result:
Akonadi should detect and reuse an existing Google account/resource.

Duplicate instances should be prevented unless explicitly requested.

Production behavior should avoid duplicate syncing and redundant entries.

Version Info:
Akonadi Source: Git master (or specify version/commit)

Distribution: openSUSE Tumbleweed (or your OS)

Behavior Confirmed: In both test and production environments

Compiler: GCC or Clang (if applicable)

Impact:
User confusion from multiple Google entries.

Redundant data syncing.

Potential for calendar/contact duplication.

Unstable or inefficient Google integration.