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

Contact information max length [varchar(255)] #2924

Closed
Leptopoda opened this issue Sep 11, 2022 · 1 comment
Closed

Contact information max length [varchar(255)] #2924

Leptopoda opened this issue Sep 11, 2022 · 1 comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working feature: contacts

Comments

@Leptopoda
Copy link
Member

Describe the bug

Coming from nextcloud/server#31207

The table structure for oc_cards_properties currently limits the length of the properties to 255 characters. In most cases this isn't a problem but it shows on quite a few NOTE fields. Most of them include something normally present in the footer of a mail. They sometimes include addresses, websites, emails, phone numbers and opening hours.
One might think that all of them should be stored in the respective field but having a quick glance at them they look like from the teem/department and not the individual person. This does not look like humanly generated and more like something a mail attached v-card would have.
Now with postgres enforcing the length limits stricter this becomes a Problem.

The current table structure from an sqldump:

CREATE TABLE `oc_cards_properties` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `addressbookid` bigint(20) NOT NULL DEFAULT 0,
  `cardid` bigint(20) unsigned NOT NULL DEFAULT 0,
  `name` varchar(64) COLLATE utf8mb4_bin DEFAULT NULL,
  `value` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `preferred` int(11) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `card_contactid_index` (`cardid`),
  KEY `card_name_index` (`name`),
  KEY `card_value_index` (`value`),
  KEY `cards_prop_abid` (`addressbookid`)
) ENGINE=InnoDB AUTO_INCREMENT=27705 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;

Steps to reproduce

NA

Expected behavior

The app should somehow warn me/limit the maximum allowed length.
The limit could also be changed on server side if 255 is not preferred.

Sadly I couldn't find any specified limit in RFC2426 and my AOSP Android contacts app happily accepts whatever I throw at it.

Actual behavior

The server/UI will happily accepts a 3.5k lorem ipsum

Contact version

4.2.0

Operating system

No response

PHP engine version

PHP 8.1

Web server

Nginx

Database

PostgreSQL

Additional info

No response

@ChristophWurst ChristophWurst added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage labels Sep 12, 2022
@Leptopoda
Copy link
Member Author

The original issue got bumped and I re tested.
The issue seems to be gone although I would need to go through the backups to validate for sure.

As I couldn't reproduce now I'm closing this one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working feature: contacts
Projects
None yet
Development

No branches or pull requests

2 participants