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

[feature/shortcuts] iOS 13 Add Shortcut parameter support #491

Merged
merged 109 commits into from
Nov 26, 2019

Conversation

hosy
Copy link
Collaborator

@hosy hosy commented Aug 30, 2019

Description

As an user I want to use the iOS Shortcuts App to interact with the ownCloud App, without opening the App. This can be very useful to save files in an ownCloud account, get files from an ownCloud account and to use this for further Shortcut steps. This is a powerful feature for power users.

With the new automation rules you can also auto backup files and photos in your ownCloud. This is really a game changer!

Implemented Intents:

  • Get list of bookmarks

    Parameters:

    • None

    Return Value:

    • List of Bookmarks

    Errors:

    • Pass Code enabled
  • Get bookmark

    Parameters:

    • Bookmark UUID

    Return Value:

    • Bookmark

    Errors:

    • Pass Code enabled
    • Bookmark does not exists
  • Get directory listing for a bookmark

    Parameters:

    • Bookmark
    • Path (can be empty, if empty root path will be used)

    Optional:

    • Sort Type
    • Sort Direction

    Return Value:

    • Array of Paths

    Errors:

    • Pass Code enabled
    • Bookmark does not exists
    • Path does not exists
  • Get file for a bookmark

    Parameters:

    • Bookmark
    • Filepath

    Return Value:

    • File

    Errors:

    • Pass Code enabled
    • Bookmark does not exists
    • Filepath does not exists
  • Get file info

    Parameters:

    • Bookmark
    • Filepath

    Return Value:

    • File Size
    • File Modification Date
    • Is Shared
    • File Creation Date

    Errors:

    • Pass Code enabled
    • Bookmark does not exists
    • Filepath does not exists
  • Create folder in directory for a bookmark

    Parameters:

    • Bookmark
    • Path
    • Folder name

    Return Value:

    • Filepath

    Errors:

    • Pass Code enabled
    • Bookmark does not exists
    • Path does not exists
  • Check if Path exists

    Parameters:

    • Bookmark
    • Path

    Return Value:

    • Bool

    Errors:

    • Pass Code enabled
    • Bookmark does not exists
  • Import file in directory for a bookmark

    Parameters:

    • Bookmark
    • Path
    • File
    • File name (optional)
    • File extension (optional)

    Return Value:

    • Filepath

    Errors:

    • Pass Code enabled
    • Bookmark does not exists
    • Path does not exists
  • Delete Path Item

    Parameters:

    • Bookmark
    • Path

    Return Value:

    Errors:

    • Pass Code enabled
    • Bookmark does not exists
    • Path does not exists

Related Issue

#463

Motivation and Context

As a power user I want to save and get files via Shortcuts.app.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Test plan:

https://github.com/owncloud/QA/blob/master/Mobile/iOS-app/Version%201.2.0/Shortcuts.md

Bugs & improvements

felix-schwarz and others added 30 commits June 30, 2019 22:57
- uploads use new OCCoreOptionAutomaticConflictResolutionNameStyle option to automatically resolve naming conflicts during upload
- Duplicate action uses the new OCCore name suggestion API to
	- determine naming conflicts and resolve them automatically
	- match the name style of the file to duplicate, f.ex.
		- duplicating "File copy.jpg" will create "File copy 2.jpg"
		- duplicating "File (1).jpg" will create "File (2).jpg"
		- duplicating "File Kopie 2.jpg" will create "File Kopie 3.jpg"
- folder creation uses the new OCCore name suggestion API to
	- detect naming conflicts beforehand
	- pre-fill the new folder name name with an unused name directly
…es will be deleted to give the user a UI feedback
…y log file using new SDK protocol

- Show SDK commit hash in Settings
* Rename updates the currently visible file in the gallery

* Keeping gallery alive fix

- Don’t pop to the root view controller on destructive action by default
- Only pop to the root if all items have been deleted
- Select next item upon deletion of the current ones
- Update UIPageViewController data source if number of items changes due e.g. to duplication or deletion

* Small fixes

* Fixed review findings
* Media player implemented using AVKit

* Added possibility to stream audio / video

* Improved error handling

* Fixed review finding

* Added background audio, airplay and PiP mode

* Propagating safe area to the main view of AVPlayerViewController

* Another fix for safe area considering layout of AVPlayerViewController

* Updated to latest develop version of SDK
Log device, version and locale info #446
Added an activity indicator for deleting offline copies #438
Naming improvements for upload, duplicate and folder creation #430
…was dismissed

- use the current development SDK
- fixed create folder action
- delete local copy, if needed
- code review changes
	- add additional safeguard so duplicate files are only deleted if they were actually duplicated (previously non-duplicate files could be removed if duplication or folder creation failed)
	- remove temporary container folder, too
- add 2 second delay before returning the core to give the core an opportunity to schedule the upload on a NSURLSession
@hosy
Copy link
Collaborator Author

hosy commented Oct 9, 2019

Regarding (2): To assure it works correctly is needed to set al slash at the end of the string Path. Otherwise, it will be removed one item inside the folder (i did not catch why).

I cannot reproduce it. I just tried the following:

Bildschirmfoto 2019-10-09 um 10 27 45

  • Documents folder had one item inside
  • After performing the action, the folder "Documents" was deleted

@jesmrec
Did you check it with the latest commit?

@jesmrec
Copy link
Contributor

jesmrec commented Oct 10, 2019

I got a couple of GIFs to clarify the scenario.

I have a "Documents" folder which contain:

  • 3 Files (a jgp, a txt, and a odt)
  • A folder called "Folder1", which contains other 3 files

Something like that:

-- Documents
   -- 1366_2000.jpg
   -- Example.odt
   -- text.txt
   -- Folder1
      -- filelist1
      -- filelist2
      -- filelist3

The action is:

Screenshot 2019-10-10 at 11 57 07

After executing, only the folder "Folder1" was removed (i check the "Deleted" section):

ezgif com-resize (4)

These are the sent requests:

Screenshot 2019-10-10 at 11 11 40

Now, i add a slash to the folder name in the action:

Screenshot 2019-10-10 at 12 16 20

executing again, and the Documents folder is removed.

@hosy, did you check with a folder that contains also subfolders?

@jesmrec
Copy link
Contributor

jesmrec commented Oct 11, 2019

After the last commits, this is the behaviour i noticed:

Action:

Delete Item at path /Documents in <account>

Documents exists and ist accesible with the structure described above.

Executions of the shortcut:

Execution 1: Folder is deleted correctly

Execution 2: Only one item inside the folder is deleted

Execution 3: Folder is deleted correctly

Execution 4: Only one item inside the folder is deleted

Execution 5: Folder is deleted correctly
(etc...)

@jesmrec
Copy link
Contributor

jesmrec commented Oct 11, 2019

Attached some logs

Action is:

Delete Item at path /New in <account>

You should find an execution in which the folder \News is correctly deleted, and another execution in which the file GIt_fitst_steps.odt is removed instead of the folder. This file is place in /New/GIt_fitst_steps.odt.zip in the account's folder structure.

ownCloud_11_Oct_2019_at_15_09_02.log.txt

# Conflicts:
#	ownCloud.xcodeproj/project.pbxproj
@hosy
Copy link
Collaborator Author

hosy commented Oct 21, 2019

@jesmrec I tried your same setup approx. 30-40 times and I cannot reproduce the error. Please can you test it again?

@jesmrec jesmrec removed this from QA in progress in Sprint 15 Oct 22, 2019
@jesmrec jesmrec added this to QA in progress in Sprint 16 Oct 22, 2019
@jesmrec jesmrec added this to QA in progress in iOS - Sprint 16 Oct 22, 2019
@jesmrec
Copy link
Contributor

jesmrec commented Oct 22, 2019

I still reproduce it, with two different devices.

Since we are in a deadlock with this issue, these are options to take:

  • Merge and open separate issue, in order not to block the release... but assuming this can bother those users who also reproduce
  • Check with more beta testers after merging
  • Check with more beta testers before merging
  • Try to schedule a call, so i can show you what i see... maybe it can help.
  • More ideas welcome.

@hosy

@hosy
Copy link
Collaborator Author

hosy commented Oct 23, 2019

@jesmrec please add more information:

  • server version
  • iOS version
  • device type
  • export and add your workflow

Is it possible to test the same scenario with the demo.owncloud.com server?

@jesmrec
Copy link
Contributor

jesmrec commented Oct 23, 2019

iPhoneX, iOS 13.1.2
iPadPro, iOS 13.1.3

Server: 10.2.1 (local docker). Also tested and reproducible with https://demo.owncloud.com/ which is 10.2.1 as well.

What do you mean with export and add your workflow ?

@hosy
Copy link
Collaborator Author

hosy commented Oct 23, 2019

@jesmrec in the Shortcuts.app you can export the shortcut, which you have created, and attach it here.

@jesmrec
Copy link
Contributor

jesmrec commented Oct 23, 2019

in order to export, it is required to enable the untrusted shortcuts in device settings (because that, i did not find the option to export).

The only way is creating an iCloud link.

@hosy
Copy link
Collaborator Author

hosy commented Oct 29, 2019

@jesmrec please can you share the folder structure as a zip file?

@jesmrec
Copy link
Contributor

jesmrec commented Oct 29, 2019

This is the structure (to copy in root folder):

archive.tar.gz

and the shortcut:

Delete Item path /AAAA in <account>

@jesmrec jesmrec removed this from QA in progress in Sprint 16 Nov 4, 2019
@jesmrec jesmrec removed this from QA in progress in iOS - Sprint 16 Nov 4, 2019
@jesmrec jesmrec modified the milestones: 1.2.0-Current, 1.3.0-Next Nov 4, 2019
@jesmrec
Copy link
Contributor

jesmrec commented Nov 7, 2019

The problem is fixed, at least not reproducible anymore.

@jesmrec jesmrec added the Approved by QA Approved by QA label Nov 7, 2019
@hosy hosy changed the base branch from milestone/1.2 to milestone/1.3 November 26, 2019 18:29
# Conflicts:
#	ios-sdk
#	ownCloud.xcodeproj/project.pbxproj
#	ownCloud/Resources/Info.plist
#	ownCloudAppShared/Client/SortMethod.swift
@hosy hosy merged commit 9143136 into milestone/1.3 Nov 26, 2019
@delete-merged-branch delete-merged-branch bot deleted the feature/shortcuts branch November 26, 2019 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants