No OCS message when updating a share

Open Beginner friendly
#37,653 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php
Domain
api

Research direction

Start at the OCS share-update entry point for the PUT shares endpoint and inspect the API tests, which currently do not assert response messages consistently. Confirm that a successful update returns OK, then add coverage for this response in the relevant API test.

Written by the indexing model from the issue text.

Description

discussion Type:Bug

Request:

PUT /owncloud-core/ocs/v1.php/apps/files_sharing/api/v1/shares/391 HTTP/1.1
Host: localhost
User-Agent: GuzzleHttp/6.5.4 curl/7.68.0 PHP/7.3.19-1+ubuntu20.04.1+deb.sury.org+1
Authorization: Basic QWxpY2U6MTIzNDU2
OCS-APIREQUEST: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 14

permissions=31

Response:

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message/>
  <totalitems></totalitems>
  <itemsperpage></itemsperpage>
 </meta>
 <data>
  <id>391</id>
  <share_type>0</share_type>
  <uid_owner>Alice</uid_owner>
  <displayname_owner>Alice Hansen</displayname_owner>
  <permissions>31</permissions>
  <stime>1594023692</stime>
  <parent/>
  <expiration/>
  <token/>
  <uid_file_owner>Alice</uid_file_owner>
  <displayname_file_owner>Alice Hansen</displayname_file_owner>
  <additional_info_owner/>
  <additional_info_file_owner/>
  <path>/Alice-folder</path>
  <item_type>folder</item_type>
  <mimetype>httpd/unix-directory</mimetype>
  <storage_id>home::Alice</storage_id>
  <storage>556</storage>
  <item_source>2147537010</item_source>
  <file_source>2147537010</file_source>
  <file_parent>2147536991</file_parent>
  <file_target>/Alice-folder</file_target>
  <share_with>Brian</share_with>
  <share_with_displayname>Brian Murphy</share_with_displayname>
  <share_with_additional_info/>
  <mail_send>0</mail_send>
  <attributes/>
 </data>
</ocs>

I would expect it to be
<message>OK</message>

probably that is the case in more places, the API tests don't check the message a lot

found it when looking into https://github.com/owncloud/ocis-reva/issues/332

Dominant language
PHP
Stars
8.8k
Forks
2.1k
Avg merge
20h 7m
Merged PRs (30d)
41

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.

More from owncloud/core

All issues in owncloud/core

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.