[Bug]: (apps/dav) oc_cards_properties value is too short for contact categories
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
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
- add contact to a quite big number of groups with long names, so CATEGORIES field exceed 254 chars
- try to add group attendee from calendar app
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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