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

Shared files disappear from conversation thread after leaving conversation #7009

Closed
old-mouse opened this issue Mar 16, 2022 · 7 comments · Fixed by #7130
Closed

Shared files disappear from conversation thread after leaving conversation #7009

old-mouse opened this issue Mar 16, 2022 · 7 comments · Fixed by #7130
Assignees
Labels
1. to develop bug feature: upload & shares & voice 📤🎙️ Sharing files into a chat and audio recordings
Milestone

Comments

@old-mouse
Copy link

old-mouse commented Mar 16, 2022

Steps to reproduce

  1. Start conversation with somebody.
  2. Upload new file using "Upload new files" or "Share from files".
  3. Select "Leave conversation".
  4. Rejoin conversation.

Expected behaviour

Shared files should remain in conversation thread. Or (if this is a feature) at least some warning message about "possible data loss" should appear.

Actual behaviour

Shared files are replaced with message "You shared a file which is no longer available".
Actually uploaded files are still present at sender's NextCloud storage.

Server configuration detail

Operating system: Linux 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1 (2022-03-07) x86_64

Webserver: Apache/2.4.52 (Debian) (apache2handler)

Database: mysql 10.5.12

PHP version:

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

Nextcloud version: 23.0.2 - 23.0.2.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.9.0
 - activity: 2.15.0
 - admin_audit: 1.13.0
 - cloud_federation_api: 1.6.0
 - contacts: 4.0.8
 - contactsinteraction: 1.4.0
 - dav: 1.21.0
 - federatedfilesharing: 1.13.0
 - files: 1.18.0
 - files_pdfviewer: 2.4.0
 - files_rightclick: 1.2.0
 - files_sharing: 1.15.0
 - files_versions: 1.16.0
 - files_videoplayer: 1.12.0
 - issuetemplate: 0.7.0
 - logreader: 2.8.0
 - lookup_server_connector: 1.11.0
 - mail: 1.11.7
 - nextcloud_announcements: 1.12.0
 - notifications: 2.11.1
 - oauth2: 1.11.0
 - password_policy: 1.13.0
 - photos: 1.5.0
 - privacy: 1.7.0
 - provisioning_api: 1.13.0
 - recommendations: 1.2.0
 - serverinfo: 1.13.0
 - settings: 1.5.0
 - sharebymail: 1.13.0
 - spreed: 13.0.3
 - support: 1.6.0
 - survey_client: 1.11.0
 - text: 3.4.0
 - theming: 1.14.0
 - twofactor_backupcodes: 1.12.0
 - twofactor_totp: 6.2.0
 - updatenotification: 1.13.0
 - user_status: 1.3.1
 - viewer: 1.7.0
 - workflowengine: 2.5.0
Disabled:
 - circles
 - comments
 - dashboard
 - encryption
 - federation
 - files_external
 - files_trashbin
 - firstrunwizard
 - ojsxc
 - systemtags
 - user_ldap
 - weather_status

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "X.X.X.X"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "23.0.2.1",
    "overwrite.cli.url": "http:\/\/X.X.X.X",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "proxy": "X.X.X.X:3128",
    "log_type": "file",
    "logfile": "nextcloud.log",
    "loglevel": 2,
    "app_install_overwrite": [
        "issuetemplate"
    ]
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Edg/99.0.1150.39

Operating system:

Logs

Web server error log
Insert your web server log here 
Nextcloud log
Insert your Nextcloud log here
Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@nickvergessen
Copy link
Member

Seems to be intentional:

$listener = static function (RemoveUserEvent $event): void {
$room = $event->getRoom();
/** @var self $roomShareProvider */
$roomShareProvider = \OC::$server->get(self::class);
$roomShareProvider->deleteInRoom($room->getToken(), $event->getUser()->getUID());
};
$dispatcher->addListener(Room::EVENT_AFTER_USER_REMOVE, $listener);

It's there since the beginning of sharing basically:
1918604

@danxuliu and memory about this decision?
Group shares also are not deleted when you are removed from a group etc. 🤔

@nickvergessen nickvergessen added this to the 💔 Backlog milestone Mar 17, 2022
@nickvergessen nickvergessen added 1. to develop feature: upload & shares & voice 📤🎙️ Sharing files into a chat and audio recordings and removed 0. Needs triage labels Mar 17, 2022
@danxuliu
Copy link
Member

danxuliu commented Mar 18, 2022

@danxuliu and memory about this decision?

I thought it made sense 🤷 From the pull request description: In the same way that a user must be a participant of a room to send a message to it a user must be a participant of a room to share a file with it [...]. Similarly, when a user leaves a room she has no longer access to the shares in the room; for consistency, her own shares are also removed.

Group shares also are not deleted when you are removed from a group etc. 🤔

I would expect my shares to be removed when I leave a room (or group!), but I could also understand it if they were kept, so if it makes more sense to keep them for consistency with group shares then fine by me too.

@nickvergessen
Copy link
Member

@jancborchardt @nimishavijay @marcoambrosini any preference from UX perspective? What would be the user assumption?

@old-mouse
Copy link
Author

Ohh, I've forgotten to mention, that text messages are retained when I leave conversation. Only files are removed.

@marcoambrosini
Copy link
Member

I'd assume that the files stay in the conversation. That's what happens in most messengers, but of course the files are sort of "owned" by the conversation and not by users at that point. In our case I'd also delete the shares by default.
We should probably ask the user if they wants to keep their shares upon leaving?

@nimishavijay
Copy link
Member

any preference from UX perspective?

Files should probably stay by default, I don't think it is necessary to ask the user. If the user is deleted from the instance then it makes more sense to delete the file.

@nickvergessen
Copy link
Member

Okay, so the code in

$listener = static function (RemoveUserEvent $event): void {
$room = $event->getRoom();
/** @var self $roomShareProvider */
$roomShareProvider = \OC::$server->get(self::class);
$roomShareProvider->deleteInRoom($room->getToken(), $event->getUser()->getUID());
};
$dispatcher->addListener(Room::EVENT_AFTER_USER_REMOVE, $listener);
should be removed and the integration tests adjusted accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop bug feature: upload & shares & voice 📤🎙️ Sharing files into a chat and audio recordings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants