cozy / cozy-data-system

Deprecated - Data Layer for Cozy V2 Platform
https://cozy.io
GNU Affero General Public License v3.0
24 stars 21 forks source link

Do not alow duplicates on doctype TAG #162

Open m4dz opened 9 years ago

m4dz commented 9 years ago

Currenlty, we can create more than one tag with the same name. This would normally not happens, as long as tag name is its user primary identifier.

Reproduce In Contacts app:

  1. add a tag (e.g cozy) to a contact
  2. switch to another contact
  3. add a tag to this new contact, but do not use the autocomplete suggest (type cozy in plain in the input field) => CouchDB now contains 2 docs tag with the same name.

Expected DS should detect the duplicate entry and fallback to the existing one (so name acts as a primary key).