Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Akonadi / Tab KAddressBook greyed out #90

Closed
michaelof opened this issue Dec 13, 2016 · 48 comments · Fixed by #270
Closed

Add support for Akonadi / Tab KAddressBook greyed out #90

michaelof opened this issue Dec 13, 2016 · 48 comments · Fixed by #270
Assignees
Labels
enhancement GUI pending A pull request closing this issue has been submitted

Comments

@michaelof
Copy link

Hi all. Newbie for twinkle, installed for the first time after qutecom stopped working for new OpenSuse 42.2 release. Twinkle itself works from begin on, cool !!!

Only issue I have is that integration to KDE's KAddressBook seems not to work (anymore?). If I klick in the "Contacts" button, on the dialogue "Select Address" ("Twinkle - Auswahl Adresse" in German) only tab "local addressbook" is available. Tab "KAddressBook" is greyed out and not usable.

FYI KDE/Plasma 5.8.3, KAddressBook 4.14.10

@LubosD
Copy link
Owner

LubosD commented Dec 13, 2016

Yes, this is a known problem.

@michaelof
Copy link
Author

Twinkle 1.9.0 / Qt 5.6.1

@michaelof
Copy link
Author

THAT'S a fast answer :-)

no workaround?

@LubosD
Copy link
Owner

LubosD commented Dec 13, 2016

Nope. For time being, I'm waiting to see if KDE PIM even makes it into KDE 5. It's still based on KDE 4.

@michaelof
Copy link
Author

To be honest I'm not really interested in KAdressBook :-) I've my contacts centrally store in my private OwnCloud instance, and KAddressBook is able to connect to a cardDAV share....

But I guess also no plans for cardDAV? Would be bloody cool, as qutecom didn't have, and e.g. linphone afaik also not

@fbriere
Copy link
Collaborator

fbriere commented Jan 21, 2017

Correct me if I'm wrong, but isn't this now supposed to be handled, for better or worse, through the beast that is Akonadi?

Out of curiosity, I looked into migrating to Akonadi over the past few days. I'll spare you the details of that painful experience (it involved a lot of cursing), but it has unfortunately not been a resounding success. Basically, although I can talk with the Akonadi server, all I'm getting is an empty list of contacts. The data is there, and KAddressBook (the application) can see it fine, but it apparently remains out of my reach.

This is rather similar to what someone reported on the kde-pim mailing-list nearly six years ago. The answer, as with many such cases, involved Nepomuk, now known as Baloo. So, what the heck, I've now installed it, and it's currently busy indexing all my files. We'll see if that changes anything, but I'm not holding my breath. (sigh)

@fbriere fbriere self-assigned this Jan 24, 2017
@swamp-fish
Copy link

Hi. alot happened since 2016. Could you look at the issue nowadays? Integration with kaddressbook would be wellcomed.

@1358
Copy link

1358 commented Nov 16, 2018

I noticed the greyed-out kaddressbook tab today and found this issue.
As kaddressbook/akonadi can handle most "backends" it would be really nice if twinkle was able to access these ressources via kaddressbook, too.

@fbriere
Copy link
Collaborator

fbriere commented Dec 22, 2018

Thanks for the reminder; glad to know there's an actual interest in this feature.

I had already started working on this on a few occasions in the past two years, probably completing over 90% of the job, only to give up and put it aside each time after getting into yet another fight with Akonadi.

I guess this is the shot in the arm I needed to motivate me to finally finish the damn thing. 😄 Thanks

fbriere added a commit that referenced this issue Dec 22, 2018
Akonadi (https://community.kde.org/KDE_PIM/Akonadi) is the PIM Storage
Service in KDE Frameworks 5, effectively replacing the KAddressBook API
previously used by Twinkle 1.4.  Applications now connect to the Akonadi
server, and agents synchronize the data with various backends.

The user interface was left more or less unchanged from Twinkle 1.4, to
minimize the size of this patch.  A few notable differences:

  - The address book now features a "Synchronize" button, to synchronize
    each Akonadi "collection" (folder).  For remote agents (e.g. CardDAV,
    Google), this will update the list of contacts on the Akonadi server.

  - All collections marked as syncOnDemand ("Synchronize when selecting
    this folder") will automatically be synchronized on startup.

  - Data changes on the Akonadi server (either from agents or other
    applications) will be automatically picked up while Twinkle is
    running.

[ This option is not enabled on Travis CI, as KDE Frameworks 5 is not
available on Ubuntu trusty. ]

Closes #90.
@fbriere fbriere changed the title Tab KAddressBook greyed out Add support for Akonadi / Tab KAddressBook greyed out Dec 22, 2018
@fbriere
Copy link
Collaborator

fbriere commented Dec 22, 2018

I have now tentatively added Akonadi support to Twinkle, pushed to the akonadi branch. Although it seems to be working for me, I am not an actual user of Akonadi (or of KDE, for that matter), so that's not saying much. What it needs now is some real testing by some real users. If you are interested, please give it a try!

Building

As stated in the README, in addition to the usual dependencies, you will also need development files for Akonadi (core library) and KContacts. (On Debian/Ubuntu, these are provided by the libkf5akonadi-dev and libkf5contacts-dev packages, available since stretch and xenial.) Add -DWITH_AKONADI=On to the other build options.

Setup

Make sure Akonadi has been installed, configured, and is working correctly (obviously). You will also need another application, such as KAddressBook or KMail, for configuring agents and managing your list of contacts.

If the Akonadi server is not already running, it will be started automatically when launching Twinkle. Unfortunately, there are some problems with this (see below). For now, you should make sure to start the server beforehand (either automatically by another application, or manually with akonadictl start).

Features

All your Akonadi contacts (that have a phone number) should be listed in the address book under the Akonadi contacts tab. Their name should appear in the incoming call pop-up, and their picture should be displayed in the main window during a call. (That picture should eventually also be displayed in the incoming call popup; this will be submitted in a separate pull request for now.)

The address book now features an additional Synchronize button, which asks Akonadi to synchronize (update) all its collections (folders); this is mostly useful for remote address books. The Reload button has been left in place for now, but shouldn't be necessary, as Twinkle will automatically pick up any changes. (I have had some problems with this in the past; please let me know if this doesn't work for you.)

All folders marked as syncOnDemand ("Synchronize when selecting this folder" in KAddressBook) will be synchronized on startup. However, Twinkle does not (currently) periodically re-sync folders according to intervalCheckTime ("Automatically synchronize after ...").

Server auto-start

As mentioned before, if the Akonadi server is not initially running, it will be started automatically when launching Twinkle. Aside from being annoyingly verbose when run in a terminal, there are some problems with this, as akonadi_control does not properly clean up the resources it inherits from Twinkle, namely:

  • File descriptors: The Akonadi server and agents will keep the SIP TCP port open after Twinkle exits, preventing it from being started again.

  • Signal mask: The Akonadi server and agents will block some signals and be basically unkillable (except with SIGKILL); akonadictl stop or restart will no longer work.

A simple way to work around these issues is to use a small wrapper to clean things up before starting akonadi_control. Simply place the following script as akonadi_control in a directory in $PATH with higher precedence (such as /usr/local/bin), or rename the real akonadi_control and place the script in its stead. (In either case, adjust the TARGET variable to your situation.)

    #!/usr/bin/env python3
    #
    # Akonadi Server wrapper for Twinkle
    #
    # This requires Python 3.3 or later; it may also be Linux-specific.
    
    import os
    import signal
    
    # Full pathname of the real Akonadi server
    TARGET = "/usr/bin/akonadi_control"
    
    # Reset the signal mask
    signal.pthread_sigmask(signal.SIG_SETMASK, [])
    
    # Close all file descriptors, except for stdin/stdout/stderr
    for fd in [int(f) for f in os.listdir("/proc/self/fd")]:
        if fd > 2:
            try:
                os.close(fd)
            except OSError:
                pass
    
    os.execl(TARGET, "akonadi_control")

Bugs

  • If a contact has several phone numbers, and therefore several entries, their order may change from one reload to the next.

  • According to my notes, when I was working on this last year, I sometimes got errors about the contact photo being displayed in the wrong thread. I can't seem to reproduce this now, though. If this happens to you, please let me know.

@swamp-fish
Copy link

swamp-fish commented Dec 26, 2018

Hi.
What worked: i saw all of my contacts.
Bugs: When i pressed Synchronize button all of contacts with the exception of Personal folder(~/.local/share/contacts) disappeared(but not deleted, maybe because i had Read only mode for those directories and i have backups anyway) and i can't add them again even when i create new addressbook with this directory. Restarting akonadi didn't help, maybe rebooting will work but i can't do it right now.

UPDATE
Ok, after i closed Twinkle and reload Akonadi after some time they reappeared in Kaddressbook. After starting Twinkle i can see them again.

@fbriere
Copy link
Collaborator

fbriere commented Jan 7, 2019

@swamp-fish Thanks for giving this a try! Did this bug only happen once, or is this something you can reproduce?

@swamp-fish
Copy link

@fbriere Hi, yes, it happens every time. Basically Synchronize button is the culprit of hiding the data, its not cleared, it is still there but you can't access it even with Kaddressbook.

@fbriere
Copy link
Collaborator

fbriere commented Mar 9, 2019

@swamp-fish This sounds like a bug with Akonadi itself, but I guess it's possible that I did something wrong nonetheless. Unfortunately, I'm unable to reproduce this bug, so I'll need your help to debug this a bit further.

I've (temporarily) created the akonadi-bug branch, on which I've added a quick hack: when pressing the Synchronize button, you will be able to select which collections/folders should be sync'ed in this run. The goal is to figure out which conditions trigger this bug. Does it occur on a specific folder? On any folder? Or maybe on any combination of more than X folders? (If it's the latter, I've added an optional delay between each folder, in case throttling down could help work around the issue.)

Thanks in advance for your help!

@Letterus
Copy link

@fbriere Thank you for adding this feature! This is what I was missing and looking for! I'm going to test it soon and give you some feedback!

@wazlecracker
Copy link

Adding the build option from @fbriere's post doesn't seem to work any more. The KAddressBook tab is still grayed out for me. I built from the AUR package as well as here from source.

fbriere added a commit that referenced this issue Aug 21, 2020
Akonadi (https://community.kde.org/KDE_PIM/Akonadi) is the PIM Storage
Service in KDE Frameworks 5, effectively replacing the KAddressBook API
previously used by Twinkle 1.4.  Applications now connect to the Akonadi
server, and agents synchronize the data with various backends.

The user interface was left more or less unchanged from Twinkle 1.4, to
minimize the size of this patch.  A few notable differences:

  - The address book now features a "Synchronize" button, to synchronize
    each Akonadi "collection" (folder).  For remote agents (e.g. CardDAV,
    Google), this will update the list of contacts on the Akonadi server.

  - All collections marked as syncOnDemand ("Synchronize when selecting
    this folder") will automatically be synchronized on startup.

  - Data changes on the Akonadi server (either from agents or other
    applications) will be automatically picked up while Twinkle is
    running.

[ This option is not enabled on Travis CI, as KDE Frameworks 5 is not
available on Ubuntu trusty. ]

Closes #90.
fbriere added a commit that referenced this issue Aug 21, 2020
Akonadi (https://community.kde.org/KDE_PIM/Akonadi) is the PIM Storage
Service in KDE Frameworks 5, effectively replacing the KAddressBook API
previously used by Twinkle 1.4.  Applications now connect to the Akonadi
server, and agents synchronize the data with various backends.

The user interface was left more or less unchanged from Twinkle 1.4, to
minimize the size of this patch.  A few notable differences:

  - The address book now features a "Synchronize" button, to synchronize
    each Akonadi "collection" (folder).  For remote agents (e.g. CardDAV,
    Google), this will update the list of contacts on the Akonadi server.

  - All collections marked as syncOnDemand ("Synchronize when selecting
    this folder") will automatically be synchronized on startup.

  - Data changes on the Akonadi server (either from agents or other
    applications) will be automatically picked up while Twinkle is
    running.

[ This option is not enabled on Travis CI, as KDE Frameworks 5 is not
available on Ubuntu trusty. ]

Closes #90.
@fbriere
Copy link
Collaborator

fbriere commented Aug 21, 2020

@wazlecracker This feature has not been brought into the main branch yet; you need to checkout/download the akonadi branch.

(Incidentally, I've just rebased the akonadi and akonadi-bug branches to include every change from the past two years.)

@sotel
Copy link

sotel commented Jan 22, 2021

KAdressbook (and the framework behind, Akonadi) hits the version v5.15.3 on its plattform KDE Plasma in v20.07.80 and will be also part of upcoming Debian 11 Bullseye.

So please make it possible to establish a contact to Akonadi/KAddressbook. This will extent Twinkles possibilities into an unlimited space....

Thanks a lot!!

@Letterus
Copy link

It seems this branch needs some testing before merging. Willing to do so. Going to report my results.

@Fietze
Copy link

Fietze commented Jan 20, 2022

Hello fbriere and others,

I'm very glad that I found this discussion, because I've been looking for a solution for quite a while.
Apparently, there are already some activities ongoing, but I'm not quite sure what the current status is. Would it be helpful to run some tests? If required I'd volunteer, of course on my current OS as this is the one I know fairly well.
Apart from KAddressbook I'm running a similar configuration as michaelof. However, the relation between Nextcloud and KAddressBook is bi-directional, therefore any change in KAddressBook will be reflected in Nextcloud during the next synchronization. The good thing is that it works with the mobile phone as well, hence one and the same data base on all devices!

Please find my structured bug report hereunder.
Thanks a lot!

Klaus

Bug Report: Access KAddressBook through Twinkle

Steps to reproduce the issue

  1. Open Twinkle
  2. Click the Address Book button
  3. There are two tabs
    • "Local address book" - accessible
    • "KAddressBook" - not accessible (greyed out)

What's the expected result?

  • When clicking the "KAddressBook button the KDE Addressbook should open and should show all contact that have a telephone number entry.
  • Vice versa, when clicking a telephone number of a KAddressBook contact a context menu should ask, which of the available services (SIP, Skype, etc.) should be launched.

What's the actual result?

  • The "Local address book" works fine; KAddressBook is not available at all

My System Details

Operating System: openSUSE Tumbleweed 20220117
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.0-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-7700T CPU @ 2.90GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 630

Twinkle 1.10.2 - 14 February 2018
Copyright (C) 2005-2015 Michel de Boer and contributors

@Letterus
Copy link

I gave up on using Twinkle because the bugs were too many and I do not have time to work on it.

@sebastianha
Copy link

I gave up on using Twinkle because the bugs were too many and I do not have time to work on it.

Just out of curiosity: What do you use? I am still searching for a good SIP client with encryption. I ended up using linphone but this is also far from perfect.

@Fietze
Copy link

Fietze commented Feb 20, 2022

@fbriere
Bon soir Frédéric,
I have started some investigations, but did not get that far. Firstly, I am not quite experienced with all that build stuff, but willing to learn and willing to add my humble contribution to this project. I hope with a little help from your side, this will be possible. What have I done?
I have uninstalled the Twinkle release 1.10.2 from the official Tumbleweed repository I had used so far. Then I have downloaded the source code from the Akonadi branch, have unpacked it in a separate folder and have started the build procedure according to your instruction.
As expected, it ended up with a bunch of error messages. Two of them struck my eyes:

  1. A warning concerning my cmake version. I am currently running version 3.22.2. Why is this a problem?
  2. An error message "Could NOT find LibXml2". Actually, my distribution provides libxml2-2. Have I got to install the lower version?

Please find the log file attached and advise.
I am not sure whether this is the right place to discuss this kind of details. Feel free to write to my e-mail address. It may be more efficient to sort out the details off the record.

CMakeOutput.log

@fbriere
Copy link
Collaborator

fbriere commented Feb 20, 2022

I am not quite experienced with all that build stuff, but willing to learn and willing to add my humble contribution to this project.

Thank you for your help!

1. A warning concerning my cmake version. I am currently running version 3.22.2. Why is this a problem?

Nah, just ignore those. (Our CMakeLists are full of archaic stuff, but they aren't breaking yet.)

2. An error message "Could NOT find LibXml2". Actually, my distribution provides **libxml2-2**. Have I got to install the lower version?

No, that's just the library; you need libxml2-dev as well.

(If you were running Debian/Ubuntu, I'd offer to build you a packaged copy, but I unfortunately don't know anything about openSUSE.)

@Fietze
Copy link

Fietze commented Feb 20, 2022

I managed to install all missing cmake elements bit by bit. Then I ran make, which looked not too bad in the beginning but stopped at 84%, as you can see from the attached terminal outputs.
It says that AkonadiCore/Collection is missing. However, I have got libKF5AkonadiCore5 version 21.12.2 installed. What needs to be done to continue?
While I am doing all this, Kontact and thus Akonadi is running in the background. Should I have closed it during make?

I guess openSUSE is not that different from other distributions. At the end, it is still Linux...
For today, I am calling it a day. Tomorrow morning, I can continue.

Make Twinkle.txt

@fbriere
Copy link
Collaborator

fbriere commented Feb 20, 2022

It says that AkonadiCore/Collection is missing. However, I have got libKF5AkonadiCore5 version 21.12.2 installed.

When compiling, you need the -devel package for each library. For openSUSE, this would be akonadi-server-devel and kcontacts-devel, if I'm not mistaken.

That said, CMake should have caught this from the start. Did you get the Akonadi OK message when running cmake? (I'm racking my brains trying to figure out how your situation could have ever happened.)

While I am doing all this, Kontact and thus Akonadi is running in the background. Should I have closed it during make?

It doesn't matter either way.

@Fietze
Copy link

Fietze commented Feb 21, 2022

I have got these packages installed:
akonadi-server-devel version 21.12.2,
kcontacts-devel version 5.90.0
From my memory CMake did not return any error. I have run it again with the same parameters, please find the output attached.
By the way, this morning at system startup, I was not able to confirm a reminder message, which I think is issued by Akonadi. Further, the system is dump - no sound anymore. PulseAudio says "Establishing connection to Pulse Audio. Please wait...". I guess it has something to do with with the alsa-devel installation. Works again after restart!

CMake Output.txt

@fbriere
Copy link
Collaborator

fbriere commented Feb 21, 2022

That said, CMake should have caught this from the start. Did you get the Akonadi OK message when running cmake? (I'm racking my brains trying to figure out how your situation could have ever happened.)

(sigh) Akonadi 5.18.41(a.k.a. 21.11.80) has moved its header files in a different location, thus breaking the build. That version hasn't landed on Debian yet, which is why I couldn't initially reproduce this behavior.

I've now pushed a fix on the akonadi branch, so you should (finally) be able to compile successfully.

@Fietze
Copy link

Fietze commented Feb 22, 2022

This morning I downloaded the the code from the Akonadi branch and ran through the whole build procedure without any major problem. There were some warnings, but nothing alarming (I hope). I am attaching the outputs of all three steps to let you make your analysis.
My first experience is very promising. I ran the application from the terminal. Since I already had an instance working before and did not remove the user directory, Twinkle picked immediately up my old settings. I did even not have to enter my credentials again; it worked out of the box.
Regarding sound, I have tested two configurations:

  • internal sound card with analogue stereo duplex over headphones
  • external digital stereo over HDMI and USB microphone

switching is done with Pulse-Audio.
Then I created an entry of the KDE Application Launcher. It worked fine either. And after having run the Diamondcard Echo Test I have called a friend using my KAddressbook. I worked like a charm. Actually, I have got my own Nextcloud server as the central data base. This synchronises with my Kontact instance under openSUSE Tumbleweed as well as with my cell phone under LineageOS 17.1. Therefore, I have entered all contact phone numbers in the international format with a leading "+" for the country code, e.g. +33 for France. I was afraid, this would not work and would oblige me rewrite everything with leading zeros, but it works well.
The Akonadi contacts tab shows the full name, the phone number and the type (work, home, mobile etc.) So, there are no worries which one to choose. I don't care about the order.
Thank you once more, Frédéric, for your help !
Let me know if I can be of further assistance. Anyway, I will raise my hand if I find a bug.

cmake output.txt
make output.txt
make install output.txt

@fbriere
Copy link
Collaborator

fbriere commented Feb 23, 2022

And after having run the Diamondcard Echo Test

Does this perchance mean that you have an actual Diamondcard account? I've been looking for someone to give me a hand with #186, so let me know if you're up for it.

Let me know if I can be of further assistance.

Two things come to mind:

  • Does Twinkle properly pick up any changes in your contacts, in real-time, without any interaction necessary?
  • Does clicking "Synchronize" cause anything weird to happen, similar to what @swamp-fish reported a long time ago?

Anyway, I will raise my hand if I find a bug.

Please do! Thanks!

@fbriere
Copy link
Collaborator

fbriere commented Feb 23, 2022

That said, I suspect there's something that could be done about associating Twinkle with sip: URLs or something. I'll try looking into that, although this is independent of Akonadi.

For the record, this is now covered by #259.

@Fietze
Copy link

Fietze commented Feb 23, 2022

Yes, I have got a Diamondcard account that I have been using for years. However, I only use it for calls, not for receiving calls as I am not on the computer all the time.
During compiling, I have not put the parameter "-DWITH_DIAMONDCARD=On" because it is marked "broken". Anyway, I have no idea what it is good for, but it would be my pleasure to give you a hand.
Concerning your first question, I have run a simple test consisting in correcting some wrong choices from the past. I have removed the "preferred" flag from phone numbers and have changed others from "home/voice" to "home" only. These modifications were immediately reflected in Twinkle.
Regarding the Synchronize button, I have not tested it, because I don't know what is supposed to be synchronized.
You don't need to bother with explaining me; if there is an instruction somewhere out in the web just send me the link.
Thank you !

@Fietze
Copy link

Fietze commented Feb 27, 2022

I have done as requested:

  • Hit the "Synchronize" button. Cannot see any consequence. At the first glance all contacts are still there.
  • Ran cmake with additional "-DWITH_DIAMONDCARD=On". Seems to work well; no error message. I am attaching the terminal output.

Cmake Twinkle-Akonadi Output.txt

@fbriere
Copy link
Collaborator

fbriere commented Mar 1, 2022

Anyway, I have no idea what it is good for, but it would be my pleasure to give you a hand.

Cool. I'll provide more information in #186.

Regarding the Synchronize button, I have not tested it, because I don't know what is supposed to be synchronized.

It asks Akonadi to synchronize (update) all its collections (folders). So, if you have any modifications on a remote backend (such as your Nextcloud setup) which haven't been propagated to your local Akonadi server yet, they should be transferred after hitting that button. (And Twinkle should be notified and pick them up automatically.)

@Fietze
Copy link

Fietze commented Mar 1, 2022

It asks Akonadi to synchronize (update) all its collections (folders). So, if you have any modifications on a remote backend (such as your Nextcloud setup) which haven't been propagated to your local Akonadi server yet, they should be transferred after hitting that button. (And Twinkle should be notified and pick them up automatically.)

As I have explained in my answer on February 23rd, Twinkle reflects all modifications I apply to my KAddressbook immediately. So, it is even not necessary to hit the Synchonize button. It is done before you can hit it.
I guess this already answer a part of the question.

@fbriere
Copy link
Collaborator

fbriere commented Mar 3, 2022

As I have explained in my answer on February 23rd, Twinkle reflects all modifications I apply to my KAddressbook immediately. So, it is even not necessary to hit the Synchonize button.

But if you add a contact on your phone and push it to your Nextcloud server, don't you have to do something in KAddressBook to bring that contact back to you (or vice versa)? This is what that button does as well. (To be clear, whether you synchronize in KAddressBook or Twinkle, the effect will be the same, and that contact will be available to all Akonadi applications at once.)

@fbriere
Copy link
Collaborator

fbriere commented Mar 5, 2022

Following up on your previous comment in #186:

In a second step, I hit the button "+ New Contact" in KAddressbook, while Twinkle was running and "Akonadi contacts" were open. I have populated the name fields and the home address fields and have hit Enter. The initials of the newly created contact are shown, but not the name!

I'm a bit confused: Are there actual initials in Akonadi? Or did Twinkle truncate the name? Could you provide me with some exact field/value data that replicates this?

The "Synchronize" button has no effect.

If this happens again, see if "Reload" fixes it. (It basically reloads the list from scratch, just like when Twinkle is started.)

@fbriere
Copy link
Collaborator

fbriere commented Mar 6, 2022

Quoting from your previous comment in #186:

KAddressbook on the desktop computer is linked to the same Nextcloud instance and synchronizes every 5 minutes.

Would it be possible for you to try temporarily disabling that synchronization, pushing a contact from your phone to Nextcloud, and hitting the "Synchronize" button in Twinkle, to confirm that it's working correctly? (I wanted to try it myself, but GMail is all I have, and it no longer works with Akonadi. Bummer.)

Incidentally, I just pushed a fix related to synchronization, so if you could compile the current version before testing, that'd be really swell. Thanks!

@Fietze
Copy link

Fietze commented Mar 6, 2022

In a second step, I hit the button "+ New Contact" in KAddressbook, while Twinkle was running and "Akonadi contacts" were open. I have populated the name fields and the home address fields and have hit Enter. The initials of the newly created contact are shown, but not the name!

I'm a bit confused: Are there actual initials in Akonadi? Or did Twinkle truncate the name? Could you provide me with some exact field/value data that replicates this?

Twinkle just does "dutifully" its job: it shows an exact copy of KAddressbook.
I am going to describe as detailed as possible what I have done:

  • After a complete restart of the system I have started Kontact and have clicked on the "Contacts" button to open the KAddressbook section.
  • Then I have opened Twinkle and have clicked on the "Addressbook" button and thereafter on the "Akonadi contacts" tab.
  • Then I have clicked on the "+ New Contact" button of KAddressbook and have filled in the name fields and the phone field with dummies.
  • The moment I hit "Enter" the new contact is created in KAddressbook and without having time to do anything else the new contact is shown in Twinkle's "Akonadi contacts". (I have kept it open all the time.)

Initials   full name

  • I have kept Twinkle's "Addressbook" and KAddressbook open and have clicked "+ New Contact" a second time.
  • Then I have repeated the same procedure as above with different dummies. This time, actually with "Name_2" and "Family_2".
  • The moment I hit "Enter" a new contact is created, of which neither the given name nor the family name is displayed; there are just initials. Consequently, Twinkle's "Akonadi contacts" lists it in the very first line:
    Initials only
    Please note: The name fields are populated, they are just not displayed. (When I edit such a contact with initials only, these fields are not empty in edit mode!)
  • To dig a bit more in, I have continued the series. Guess what? Every second newly created contact does only display initials. However, if Twinkle's "Addressbook" is closed, newly created contacts show up correctly.
    I hope this will bring some more light into the matter and will help to fix the bug.

@Fietze
Copy link

Fietze commented Mar 6, 2022

KAddressbook on the desktop computer is linked to the same Nextcloud instance and synchronizes every 5 minutes.

Would it be possible for you to try temporarily disabling that synchronization, pushing a contact from your phone to Nextcloud, and hitting the "Synchronize" button in Twinkle, to confirm that it's working correctly? (I wanted to try it myself, but GMail is all I have, and it no longer works with Akonadi. Bummer.)

I'm afraid, I cannot help you. My Nextcloud instance sits in a NAS. Both my desktop computer and my phone synchronize with this Nexcloud instance. Of course, I could disable synchronization between them. Then a newly created contact would never go from the phone to Nextcloud. The same applies for the desktop computer. So, Nextcloud running in a NAS container is the master. All others retrieve their information from this master.
I have run another test. As I can access the Nextcloud Contacts application through a web interface, I have created a new contact directly in Nextcloud. But nonetheless, it does not change the basics: As Akonadi is running on my desktop computer, it can only distribute new information after KAddressbook got noticed. Hence, when you see the new contact in KAddressbook you haven't got any time to hit any button in Twinkle, because the new contact is already there.
This means, in order to test Twinkle's "Synchronize" button from the "Akonadi contacts" tab we would have to prevent Twinkle from synchronizing automatically. Else Twinkle will always have the job done before you will be able to hit that button.
This is my humble opinion...
On the other hand, what would be the purpose of a button that will never be used?

@fbriere
Copy link
Collaborator

fbriere commented Mar 6, 2022

* Then I have repeated the same procedure as above with different dummies. This time, actually with "Name_2" and "Family_2".

Ah! It took me ages to realize that I could hit that ... after the name field and actually provide name components in Kontact.

Yes, I can reproduce this, even without Twinkle running. The behavior is somewhat inconsistent, and seems to hinge on whether Kontact thinks that the Name field is/was/should be empty. The resulting vCard shows:

FN: 
N:Smith;Mister;;;

So, the name components are there, but the full name is left blank. I definitely suggest you file a bug against Kontact/Akonadi over this.

(In the meantime, one trick I've found that seems to work is to add and immediately delete a space at the end of the full name. The cursor is already there after setting the components, so it's just two extra keystrokes.)

@fbriere
Copy link
Collaborator

fbriere commented Mar 7, 2022

On the other hand, what would be the purpose of a button that will never be used?

Since all Akonadi applications (that I have seen) provide a way to synchronize/update collections/folders, I thought it would probably be a good idea to do so as well.

However, in retrospect, I would guess that 70% of all my troubles with Akonadi were due to this single feature. And to this day, I still can't make sure that it's working correctly. So I guess it's time for me to call it quits, and stop toiling over something that most people will never use anyway.

I have now pushed a new version, devoid of that cursed button. (I've left "Reload" in place for now, just in case something goes wrong and reloading fixes the issue.)

fbriere added a commit that referenced this issue Mar 7, 2022
Akonadi (https://community.kde.org/KDE_PIM/Akonadi) is the PIM Storage
Service in KDE Frameworks 5, effectively replacing the KAddressBook API
previously used by Twinkle 1.4.  Applications now connect to the Akonadi
server, and agents synchronize the data with various backends.

The user interface was left more or less unchanged from Twinkle 1.4, to
minimize the size of this patch.  A few notable differences:

  - The address book now features a "Synchronize" button, to synchronize
    each Akonadi "collection" (folder).  For remote agents (e.g. CardDAV,
    Google), this will update the list of contacts on the Akonadi server.

  - All collections marked as syncOnDemand ("Synchronize when selecting
    this folder") will automatically be synchronized on startup.

  - Data changes on the Akonadi server (either from agents or other
    applications) will be automatically picked up while Twinkle is
    running.

Closes #90.
@fbriere fbriere added GUI pending A pull request closing this issue has been submitted and removed help wanted labels Mar 7, 2022
@Fietze
Copy link

Fietze commented Mar 8, 2022

Yes, I can reproduce this, even without Twinkle running. The behavior is somewhat inconsistent, and seems to hinge on whether Kontact thinks that the Name field is/was/should be empty.

Thanks to your remark, I did the test again without keeping the Twinkle window open. I confirm your observation that KAddressbook's strange behaviour has nothing to do with Twinkle. I thought it had, because when I tested the matter in KAddressbook only, I did it only once, and it worked. But as you say, the behaviour is inconsistent, it requires several attempts to see it.
I have filed the bug report Bug 451237 in KDE Bugtracking.
And thanks for the trick to make KAddressbook accept names! It works like a charm with only two extra keystrokes!

@Fietze
Copy link

Fietze commented Mar 8, 2022

Since all Akonadi applications (that I have seen) provide a way to synchronize/update collections/folders, I thought it would probably be a good idea to do so as well.

I am desperately sorry that I cannot help you testing this button. As I said, in my setup, I even do not have time to hit this button. In the second I release a modification in any contact of KAddressbook, it is showing up in Twinkle's "Akonadi contacts" tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement GUI pending A pull request closing this issue has been submitted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants