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

cannot accept identical pending shares from different user serially #2131

Closed
kiranparajuli589 opened this issue Jun 7, 2021 · 3 comments
Closed
Labels
OCIS-Fastlane Planned outside of the sprint Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug

Comments

@kiranparajuli589
Copy link
Contributor

kiranparajuli589 commented Jun 7, 2021

Describe the bug

When a user receives two shares with identical names from different users and he/she tries to accept the pending shares one by one, the first one can be accepted, but while accepting the other one, error is thrown.

Steps to reproduce

Steps to reproduce the behavior:

  1. create three users uu1, uu2, uu3
  2. upload the same file testfile.txt for user uu1, uu2
  3. share the file from uu1 to uu3 and uu2 to uu3
  4. list all shares for uu3
{
  "ocs": {
    "meta": {
      "status": "ok",
      "statuscode": 200,
      "message": "OK"
    },
    "data": [
      {
        "id": "11ed63b9-4bb2-4c49-a6e6-dd1db5ae4e18",
        "share_type": 0,
        "uid_owner": "uu1",
        "displayname_owner": "uu1",
        "additional_info_owner": "uu1@oc.np",
        "permissions": 1,
        "stime": 1623071308,
        "parent": "",
        "expiration": "",
        "token": "",
        "uid_file_owner": "uu1",
        "displayname_file_owner": "uu1",
        "additional_info_file_owner": "uu1@oc.np",
        "state": 1,
        "path": "/testfile.txt",
        "item_type": "file",
        "mimetype": "text/plain",
        "storage_id": "1284d238-aa92-42ce-bdc4-0b0000009157",
        "storage": 0,
        "item_source": "MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3OjZkOGY1NTAxLTNlNmEtNDBhMy1hNjczLTNkZTg4Y2U2ZmYyMg==",
        "file_source": "MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3OjZkOGY1NTAxLTNlNmEtNDBhMy1hNjczLTNkZTg4Y2U2ZmYyMg==",
        "file_parent": "",
        "file_target": "/testfile.txt",
        "share_with": "uu3",
        "share_with_displayname": "uu3",
        "share_with_additional_info": "uu3@oc.np",
        "mail_send": 0,
        "name": ""
      },
      {
        "id": "6403bd1e-5a51-4e52-8b33-beec5c08b2bd",
        "share_type": 0,
        "uid_owner": "uu2",
        "displayname_owner": "uu2",
        "additional_info_owner": "uu2@oc.np",
        "permissions": 1,
        "stime": 1623071318,
        "parent": "",
        "expiration": "",
        "token": "",
        "uid_file_owner": "uu2",
        "displayname_file_owner": "uu2",
        "additional_info_file_owner": "uu2@oc.np",
        "state": 1,
        "path": "/testfile.txt",
        "item_type": "file",
        "mimetype": "text/plain",
        "storage_id": "1284d238-aa92-42ce-bdc4-0b0000009157",
        "storage": 0,
        "item_source": "MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3Ojg1MzdhZmYxLTYyNWYtNDMxOS1iYjliLTBkY2ExZWQ5ZGYxMQ==",
        "file_source": "MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3Ojg1MzdhZmYxLTYyNWYtNDMxOS1iYjliLTBkY2ExZWQ5ZGYxMQ==",
        "file_parent": "",
        "file_target": "/testfile.txt",
        "share_with": "uu3",
        "share_with_displayname": "uu3",
        "share_with_additional_info": "uu3@oc.np",
        "mail_send": 0,
        "name": ""
      }
    ]
  }
}

2 pending shares

  1. Accept the first pending share: status: ok
  2. Accept the second pending share:

Expected behavior

  • share should be accepted with status: ok

Actual behavior

***~/www/ocConfigs master!5 ?3 ❯ curl -k -u uu3:uu3 -XPOST https://localhost:9200/ocs/v2.php/apps/files_sharing/api/v1/shares/pending/6403bd1e-5a51-4e52-8b33-beec5c08b2bd\?format\=json | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   106  100   106    0     0   6235      0 --:--:-- --:--:-- --:--:--  6235
{
  "ocs": {
    "meta": {
      "status": "error",
      "statuscode": 996,
      "message": "grpc update received share request failed"
    }
  }
}

Setup

export OCIS_URL=https://localhost:9200                         18:57:09
export STORAGE_HOME_DRIVER=ocis                         
export STORAGE_USERS_DRIVER=ocis
export STORAGE_DRIVER_OCIS_ROOT=/tmp/ocis/storage/users
export STORAGE_DRIVER_LOCAL_ROOT=/tmp/ocis/local/root
export STORAGE_METADATA_ROOT=/tmp/ocis/metadata
export STORAGE_DRIVER_OWNCLOUD_DATADIR=/tmp/ocis/owncloud/data
export STORAGE_HOME_DATA_SERVER_URL=http://localhost:9155/data
export STORAGE_USERS_DATA_SERVER_URL=http://localhost:9158/data
export STORAGE_SHARING_USER_JSON_FILE=/tmp/ocis/shares.json
export PROXY_ENABLE_BASIC_AUTH=true
export WEB_UI_CONFIG=$HOME/www/ocConfigs/config.json
export IDP_IDENTIFIER_REGISTRATION_CONF=$HOME/www/ocConfigs/idp.yml
export OCIS_LOG_LEVEL=error
export SETTINGS_DATA_PATH=/tmp/ocis/settings

OCIS_VERSION=latest
BRANCH=master
STORAGE_FRONTEND_UPLOAD_DISABLE_TUS=false

Additional context

Add any other context about the problem here.

@individual-it
Copy link
Member

Accepting seems to work now, but the receiver can only access the first share

@individual-it
Copy link
Member

if both shares come from the same user, the content inside is mixed together
image

@C0rby
Copy link
Contributor

C0rby commented May 11, 2022

This works on current oCIS master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCIS-Fastlane Planned outside of the sprint Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug
Projects
Archived in project
Development

No branches or pull requests

4 participants