Empty list values and simple (non-mergeable) lists are not possible in desktopcouch

Bug #510232 reported by Eric Casteleijn
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
desktopcouch
Fix Released
High
Vincenzo Di Somma
desktopcouch (Ubuntu)
Fix Released
High
Vincenzo Di Somma

Bug Description

Currently, assigning any list or tuple value to a field in a desktopcouch.records.Record object will create a Mergeable List value, which is great in most cases, but not always:

- there is no way to create empty list values, which some applications may want to rather than remove the key.
- for lists of simple values (e.g. the "tags" in tomboy) there is no problem in determining identity of the items in the list, and so the mergeable lists are overkill.

I don't know how to best solve this, which is why I will mark this bug incomplete and assign it to Stuart who will likely come up with some really smart solution or say it doesn't need one.

Related branches

Changed in desktopcouch:
status: New → Incomplete
assignee: nobody → Stuart Langridge (sil)
importance: Undecided → Medium
Revision history for this message
Eric Casteleijn (thisfred) wrote :

After discussing the issue with Manuel de la Peña, I think the best solution would be to allow regular list values in desktopcouch records, and treat any list value in json as a regular list by default, then providing API to explicitly assign a mergeable list type value to a key in desktopcouch.

For this to work, we should put an "_is_mergeable_list": true property on each mergeable list json representation, rather than relying on the form of the keys to resemble uuids. (we should keep the checks in place that they are though.)

This automatically lifts the restrictions that you can't have empty mergeable list values as well, since the presence of the key would tell you that it is of this type.

The key is ugly, but unlikely to clash in practice, and what we have in place isn't any better.

Changed in desktopcouch:
assignee: Stuart Langridge (sil) → Ubuntu One Desktop+ team (ubuntuone-desktop+)
status: Incomplete → Triaged
Revision history for this message
Zachery Bir (urbanape) wrote :

Bindwood uses bare lists for .children elements of folders (written contra spec, I know), and takes its own pains to handle merges. I'd prefer a solution like Eric's so that clients which can deal with pure JSON lists don't have to be bulked up to account for this extra behavior.

Changed in desktopcouch:
milestone: none → 1.0
Changed in desktopcouch:
status: Triaged → In Progress
Vincenzo Di Somma (vds)
Changed in desktopcouch:
assignee: Ubuntu One Desktop+ team (ubuntuone-desktop+) → Vincenzo Di Somma (vds)
importance: Medium → High
Vincenzo Di Somma (vds)
Changed in desktopcouch:
status: In Progress → Fix Committed
Changed in desktopcouch (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Vincenzo Di Somma (vds)
milestone: none → natty-alpha-1
Changed in desktopcouch (Ubuntu):
milestone: natty-alpha-1 → natty-alpha-2
Changed in desktopcouch:
status: Fix Committed → Fix Released
Changed in desktopcouch (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.