-
Notifications
You must be signed in to change notification settings - Fork 510
Description
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Summary
When using the federated chats the actor_id of the messages will be username@some-cloud-domain.tld which may be longer than the currently allowed limit of 64 chars. For local users it's fine since the uid of each user is also limited to 64 chars, but federated user IDs may need more chars cause of the domain added.
Steps to reproduce
- Use federated chat between two Nextcloud instances.
- Create a user with a long uid like 60 chars or so. (We have long user IDs originating from our SSO)
- Write something in a federated chat with that user.
- See that the user name is not displayed in the chat, but the federated user ID truncated to 64 chars. The user avatar is not shown as well.
Also see error messages in the logs that theactor_idis truncated and the truncated domain could not be resolved by the DNS (which makes sense).
Expected behaviour
The federated user ID should not be truncated and the user information should be displayed correctly in the chat.
Actual behaviour
The federated user ID is truncated to 64 chars on database insert at the actor_id columns. As a result the federated user cannot be resolved correctly and only the truncated ID is shown in the chat.
In the logs errors like the following can be found (note the missing domain ending cause of the truncate):
CannotReachRemoteException No DNS record found for cloud.some-domain
Also during the db inserts:
DbalException An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'actor_id' at row 1
Talk app
Talk app version: 22.0.09
Custom Signaling server configured: yes 2.1.0
Custom TURN server configured: yes
Custom STUN server configured: yes
Server configuration
Operating system: Debian Trixie
Web server: Nginx
Database: MariaDB
PHP version: 8.3
Nextcloud Version: 32.0.5
Possible workaround
I've tried altering the tables to increase the size of the actor_id column.
ALTER TABLE oc_comments MODIFY actor_id VARCHAR(128) NOT NULL DEFAULT '';
ALTER TABLE oc_reactions MODIFY actor_id VARCHAR(128) NOT NULL DEFAULT '';
ALTER TABLE oc_talk_proxy_messages MODIFY actor_id VARCHAR(128) NOT NULL;(There are some other tables with 64 chars actor_id too.)
After this change the federated chat with long federated user IDs seems to be working fine.
Additionally I was able to recover old messages by adding the missing parts to the actor_id entries in oc_comments and oc_talk_proxy_messages.