After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 642251 - Key-file backend always adds entries upon linking, rather than replacing as necessary
Key-file backend always adds entries upon linking, rather than replacing as n...
Status: RESOLVED WONTFIX
Product: folks
Classification: Platform
Component: Key file backend
git master
Other Linux
: Normal normal
: Future
Assigned To: folks-maint
folks-maint
Depends on:
Blocks: 642252
 
 
Reported: 2011-02-13 21:04 UTC by Travis Reitter
Modified: 2011-08-01 19:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Travis Reitter 2011-02-13 21:04:33 UTC
If I've got a set of contacts A, B, and C, and link them as such:

A <-> B => AB
AB <-> C => ABC

The key-file backend ends up with entries in relationships.ini like:

[0]
protocol=A;B;

[1]
protocol=A;B;C;

Obviously, we don't need entry [0] once we've got entry [1].

So, there are two problems here:

1. The key-file backend has some code to eliminate duplicates from the key-file when exposing Personas, but apparently this sometimes removes the more-complete Persona (eg, [1], above), which leads to clients showing AB and C as distinct (when there should only be ABC).

2. The key-file backend needs to end up with only 1 entry when a Persona gets linked with another. I believe there's some internal hash that just gets serialized as relationships.ini when this happens. The best way to fix this would be to prevent partial duplicates in this hash in the first place.
Comment 1 Travis Reitter 2011-02-13 21:14:21 UTC
We should be sure that cases like this also get fixed (include it in a new test):

[0]
protocol=A;B;

[1]
protocol=C;D;

[2]
protocol=A;B;C;D;

(Upon the next save, [0] and [1] should be eliminated).

As well as trickier cases like:

[0]
protocol_1=A;
protocol_2=B;

[1]
protocol_2=C;D;

[2]
protocol_1=A;
protocol_2=B;C;D;
Comment 2 Travis Reitter 2011-02-13 21:17:34 UTC
Furthermore, if the key-file backend detects any partial duplicates during prepare(), it should save the file to disk just before it returns from the async prepare() call.

This will normalize the key-file for users who have upgraded Folks since this bug is fixed yet haven't added new links. Otherwise they could continue to see the consequences of this bug (eg, bug #642252).
Comment 3 Travis Reitter 2011-02-13 22:43:25 UTC
Philip, could you come up with a fix for this?
Comment 4 robert 2011-02-14 00:29:30 UTC
Surely this isn't about removing duplicates - itt should be about the core of libfolks characterising some links as "add a field to this entry" rather than "create a new entry". Surely this duplicate removing inside the relationships key-file backend isn't going to help much when [0] and [1] are entries in e-d-s with other fields, and [2] should never have been created.
Comment 5 Philip Withnall 2011-02-15 00:37:45 UTC
The key-file backend was designed to do this (i.e. this behaviour isn't a bug). The individual aggregator sorts out the soup of personas given to it by the key-file backend, and any “fix” for this bug would effectively be partially reimplementing the individual aggregator in the key-file backend.

What sounds like a bug is that the more-complete persona is being removed in some cases. Can you give a concrete test case, since I don't recall ever seeing this before?
Comment 6 Travis Reitter 2011-02-15 21:11:40 UTC
(In reply to comment #5)

> What sounds like a bug is that the more-complete persona is being removed in
> some cases. Can you give a concrete test case, since I don't recall ever seeing
> this before?

Right, so this is issue 1. in the original description.

I couldn't reproduce it in the simple case described in the description. I /may/ have seen it myself but didn't recognize it at the time. I'll make sure all my contacts are linked up and see if I ever spot them separated.
Comment 7 Travis Reitter 2011-03-25 20:09:23 UTC
Setting the milestone, since this is something we should fix (especially with the upcoming writable Tracker backend: bug #645413).
Comment 8 Travis Reitter 2011-03-25 20:09:51 UTC
(In reply to comment #7)
> Setting the milestone, since this is something we should fix (especially with
> the upcoming writable Tracker backend: bug #645413).

That is, this is a general problem we should solve for both backends and/or in libfolks.
Comment 9 Philip Withnall 2011-06-14 16:35:27 UTC
Is this still a problem?
Comment 10 Travis Reitter 2011-08-01 18:33:22 UTC
Note that this is similar to the problem in bug #653728 and may be fixed at the same time.
Comment 11 Travis Reitter 2011-08-01 18:39:28 UTC
Punting bugs that won't be fixed by Folks 0.6.0.
Comment 12 Philip Withnall 2011-08-01 19:01:45 UTC
(In reply to comment #10)
> Note that this is similar to the problem in bug #653728 and may be fixed at the
> same time.

It's dissimilar in that it matters to nobody if the key-file backend has spurious personas, since they can't be accessed any way other than through folks.

∴ Closing.