nextcloud / deck

🗂 Kanban-style project & personal management tool for Nextcloud, similar to Trello
https://apps.nextcloud.com/apps/deck
GNU Affero General Public License v3.0
1.22k stars 279 forks source link

Add unique constraint for labels (color + text) #2173

Open aproposnix opened 4 years ago

aproposnix commented 4 years ago

Steps to reproduce

Unclear how to reproduce at the moment but it may be some kind bug between the web app and the android client. On the Android client though, no duplicated tags are shown. Only on the desktop.

Expected behaviour

The user should only be allowed to select a tag once. The system should not display the same tag more than once per card.

Actual behaviour

Many cards on the web app show many duplications of the same tag.

To remove the tags, you must unselect the tags. On Android, just unselect the single tag (as the duplicates are not shown) and then reselect it. On the desktop, you will need to unclick the tags for as many times as the tag was duplicated. Selection_090

Selection_091

The mobile doesn't show any duplicates signal-2020-08-06-063821

Server configuration detail

Operating system: Linux 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64

Webserver: Apache/2.4.41 (Ubuntu) (apache2handler)

Database: mysql 10.3.22

PHP version:

7.4.3 Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, apcu, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, intl, json, exif, mysqli, pdo_mysql, apc, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Phar, Zend OPcache

Nextcloud version: 19.0.1 - 19.0.1.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status Array ( )
List of activated apps ``` Enabled: - accessibility: 1.5.0 - activity: 2.12.0 - admin_audit: 1.9.0 - apporder: 0.10.0 - bookmarks: 3.3.3 - bruteforcesettings: 1.6.0 - calendar: 2.0.3 - camerarawpreviews: 0.7.7 - cloud_federation_api: 1.2.0 - comments: 1.9.0 - contacts: 3.3.0 - contactsinteraction: 1.0.0 - dav: 1.15.0 - deck: 1.0.5 - documentserver_community: 0.1.7 - drawio: 0.9.7 - duplicatefinder: 0.0.2 - epubreader: 1.4.2 - event_update_notification: 1.0.2 - external: 3.6.0 - federatedfilesharing: 1.9.0 - federation: 1.9.0 - files: 1.14.0 - files_downloadactivity: 1.8.0 - files_markdown: 2.3.0 - files_mindmap: 0.0.22 - files_pdfviewer: 1.8.0 - files_rightclick: 0.16.0 - files_sharing: 1.11.0 - files_trashbin: 1.9.0 - files_versions: 1.12.0 - files_videoplayer: 1.8.0 - forms: 2.0.2 - gpxpod: 4.2.2 - impersonate: 1.6.1 - issuetemplate: 0.6.0 - logreader: 2.4.0 - lookup_server_connector: 1.7.0 - maps: 0.1.6 - metadata: 0.12.0 - music: 0.16.0 - news: 14.1.11 - nextbackup: 20.4.0 - nextcloud_announcements: 1.8.0 - notes: 3.6.1 - notifications: 2.7.0 - oauth2: 1.7.0 - occweb: 0.0.7 - onlyoffice: 4.3.0 - password_policy: 1.9.1 - phonetrack: 0.6.4 - photos: 1.1.0 - previewgenerator: 2.3.0 - privacy: 1.3.0 - provisioning_api: 1.9.0 - rainloop: 7.0.1 - riotchat: 0.6.2 - serverinfo: 1.9.0 - settings: 1.1.0 - sharebymail: 1.9.0 - spreed: 9.0.3 - support: 1.2.1 - survey_client: 1.7.0 - suspicious_login: 3.1.0 - systemtags: 1.9.0 - tasks: 0.13.3 - text: 3.0.1 - theming: 1.10.0 - twofactor_backupcodes: 1.8.0 - updatenotification: 1.9.0 - viewer: 1.3.0 - workflowengine: 2.1.0 Disabled: - audioplayer - encryption - files_external - firstrunwizard - guests - mail - recommendations - user_ldap ```
Configuration (config/config.php) ``` { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "aproposnix.dyndns.org" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "19.0.1.1", "overwrite.cli.url": "http:\/\/localhost\/nextcloud", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "maintenance": false, "memcache.local": "\\OC\\Memcache\\APCu", "app_install_overwrite": [ "social", "dashboard", "occweb", "issuetemplate" ], "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "updater.release.channel": "beta", "theme": "", "loglevel": 2, "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauth": 1, "mail_smtpauthtype": "LOGIN", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***" } ```

Are you using external storage, if yes which one: N/A

Are you using encryption:

Are you using an external user-backend, if yes which one: N/A

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0

Operating system: Ubuntu 20.04

Logs

Web server error log ``` ```
Nextcloud log ``` ```
Browser log
stefan-niedermann commented 4 years ago

Hi and thank you for reporting this issue. The Android client has a bug which is responsible for adding the tags multiple times. We are working on a fix right now.

Though the API should not allow that (ideally without throwing an error but silently detect the already assigned tag and just do not assign it a second time), therefore i would like to keep this issue open.

Update: The bug in the android app has been fixed in 1.9.7. Sorry for the tag spamming 😉

juliusknorr commented 4 years ago

The issue here is that we currently don't have a unique constraint on tags, so we should not allow having a tag with same color and title twice.

desperateCoder commented 4 years ago

@juliushaertl Actually you have one on the title, I'd say that's fine. The problem here is the label-assigned-to-card relationship table. The label isn't duplicate, the assignment is.

aproposnix commented 4 years ago

Closing issue... AFAIK it's fixed.

thanks everyone!

stefan-niedermann commented 4 years ago

@juliushaertl do you want to keep it open for the unqiue constraint in the relationship table?

thw26 commented 3 years ago

Just confirming I am still experiencing this issue.

Ubuntu 20.04, Nginx, Nextcloud 19.04. Accessing Deck through both the Web App and the latest Android client.

desperateCoder commented 3 years ago

@thw26 Well, the fix unfortunately won't remove the assigned labels. When you create a new card with a label, then change it a few times, does this card has duplicate labels on it? If yes, please tell us! If not, I'd consider this bug as fixed. You can just remove the duplicate labels in the web-app and the Android-app won't cause any new duplicates.

One more thing: Big, big sorry to all users for the inconveniences this bug caused! We really do our best to avoid any errors, unfortunately sometimes we miss one until we release... :disappointed:

thw26 commented 3 years ago

Creating a new tag in the web app and then clicking around on various tags for a while, selecting new ones, deselecting selected ones, does not leave any duplicate tags.

The duplicate tag I recently removed was a tag that had existed on an already existing card. I hadn't touched the card in the web app for a while. I viewed it yesterday, but did not modify the tags of the card, on an Android device in the Deck app. (I was demonstrating what Deck was to my wife.) When I accessed the web app this morning from my workstation, the duplicate tag was there.

Is https://github.com/stefan-niedermann/nextcloud-deck/issues/644 the appropriate issue?

desperateCoder commented 3 years ago

Oh. OOOOH!

Sorry @thw26, I mistakenly thought, this was our Android-Deck Repo... :sweat_smile: I'm just one of the Android app guys, saw the mail and thought we have a problem here again...

Is stefan-niedermann/nextcloud-deck#644 the appropriate issue?

Yep, thats the Issue in the Android-Deck app. It initially was our fault, not the fault of the server app (this repo). This issue is still open for the server app, so it won't allow our app to go wild and assign an insane amount of the same labels again and again. In the Android-app, we fixed it, so it has stopped to duplicate them. When this issue in the web-app is fixed, there will be constraints preventing anyone to duplicate label-assignments. In order to create these constraints, there might be a migration at update-time, wich removes the duplicates, right @juliushaertl?

So for a quick fix you could remove the duplicates manually, or just wait until this issue is fixed and the fix is released.

juliusknorr commented 3 years ago

Yes, once we make the color+text value unique we should also have a migration step to merge those assignments of tags with the same combination into one.