nextcloud / nextcloud/server

[Bug]: (apps/dav) oc_cards_properties value is too short for contact categories

Open
#55,143 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop 31-feedback bug feature: carddav
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

Cards property value is limited to 255 chars, it is too short for contact categories field.

Categories truncated so searching attendees in calendar for example returns random results depending on which groups truncated

Steps to reproduce
  1. add contact to a quite big number of groups with long names, so CATEGORIES field exceed 254 chars
  2. try to add group attendee from calendar app
  3. there is probability that required group was truncated and it fails to find all group members
Expected behavior

It adds all group members as attendee

Nextcloud Server version

31

Operating system

Other

PHP engine version

PHP 8.4

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

I was able to work it around by altering table to 4095 chars and modifying restriction in this line: https://github.com/nextcloud/server/blob/ddc272402dd5c8d220b65c7bfafd0bc1509f6f6d/apps/dav/lib/CardDAV/CardDavBackend.php#L1399

Maybe it needs more proper solution because of number of groups can be big enough.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/dav/lib/CardDAV/CardDavBackend.php around line 1399 and inspect how oc_cards_properties stores the CATEGORIES value. Reproduce the issue with contacts having long category lists, then verify that the chosen fix preserves all categories and allows calendar attendee searches to find every group member.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.