Bug 124970 - iOS: Wrong File when Opening from Nextcloud-App
Summary: iOS: Wrong File when Opening from Nextcloud-App
Status: RESOLVED DUPLICATE of bug 128577
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: iOS Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other iOS
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-26 05:20 UTC by Andreas Gruhler
Modified: 2019-11-04 12:24 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
WIP patch (9.46 KB, patch)
2019-05-16 20:35 UTC, How can I remove my account?
Details
Back button which does not close the document (784.35 KB, image/png)
2019-10-10 13:29 UTC, Andreas Gruhler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Gruhler 2019-04-26 05:20:29 UTC
Description:
I run the Collabora iOS-App 0.1(30) and the latest Nextcloud-App for iOS on the iPad.

The "back button" on the top left corner of the screen does not really close the document. I do not know, whether this is intended or not, but it might be more intuitive, if the "back button" would also close the document.

Opening and using the "back button" once works, the correct document is opened. However, after closing the first document (using the "back button") and opening a different document from within the Nextcloud-App, the previously closed document opens again, instead of the newly selected one (because the "back button" does not really close the document, I guess). Please find screen-recording in https://cloud.test.base4kids.ch/index.php/s/s52qgsmcqHokiC2.

Steps to Reproduce:
1. Open any document from within Nextcloud-App for iOS
2. Tap on the back button on the top left of the screen
3. Open **another** document from within Nextcloud-App

Actual Results:
1. The selected document appears, when opening with the Collabora App for iOS
2. The file list of the Nextcloud-App appears
3. The file opened in step 1 appears again

Expected Results:
1. The selected document appears, when opening with the Collabora App for iOS
2. The file list of the Nextcloud-App appears
3. The file selected in step 2 appears again


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Andreas Gruhler 2019-04-26 05:23:01 UTC
This could be related with:
* 123733: 'Crash when loading the same file twice but first load was not "complete"'
* 124898: 'Bad template format same session'
Comment 2 How can I remove my account? 2019-05-06 16:09:42 UTC
Clarification: with "back button on the top left of the screen" is meant the one at the very top, displayed by iOS itself, that shows a left-pointing triangle and the name of the previous app that started this Collabora Office app, "Nextcloud". Pressing this has the same effect as simply switching back to the Nextcloud app the normal way. It is not Collabora Office's own close button on its toolbar that is meant.

Anyway, yes, I can reproduce. Investigating.
Comment 3 How can I remove my account? 2019-05-06 16:22:13 UTC
when opening a doc from Nextcloud app for the first time. the following happens in the Collabora Office app: 

#0	0x0000000100ee04a0 in ::-[AppDelegate applicationWillEnterForeground:](UIApplication *) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/AppDelegate.mm:252

#0	0x0000000100ee0598 in ::-[AppDelegate application:openURL:options:](UIApplication *, NSURL *, NSDictionary *) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/AppDelegate.mm:262

#0	0x0000000100ee04e0 in ::-[AppDelegate applicationDidBecomeActive:](UIApplication *) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/AppDelegate.mm:255

#0	0x0000000100ed3b0c in ::-[DocumentViewController viewDidLoad]() at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/DocumentViewController.mm:33

#0	0x0000000100ed41d0 in ::-[DocumentViewController viewWillAppear:](BOOL) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/DocumentViewController.mm:71

#0	0x0000000100e406d4 in ::-[Document loadFromContents:ofType:error:](id, NSString *, NSError **) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/Document.mm:54

When one then switches back to the Nextcloud app, this:

#0	0x0000000100ee0420 in ::-[AppDelegate applicationWillResignActive:](UIApplication *) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/AppDelegate.mm:246

#0	0x0000000100ee0460 in ::-[AppDelegate applicationDidEnterBackground:](UIApplication *) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/AppDelegate.mm:249

And when one then chooses another document, and tells the Nextcloud app to open that one in Collabora Office, this:

#0	0x0000000100ee04a0 in ::-[AppDelegate applicationWillEnterForeground:](UIApplication *) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/AppDelegate.mm:252

#0	0x0000000100ee0598 in ::-[AppDelegate application:openURL:options:](UIApplication *, NSURL *, NSDictionary *) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/AppDelegate.mm:262

#0	0x0000000100ee04e0 in ::-[AppDelegate applicationDidBecomeActive:](UIApplication *) at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/AppDelegate.mm:255

#0	0x0000000100ed3b0c in ::-[DocumentViewController viewDidLoad]() at /Volumes/TML13/lo/online-ios-co-4/ios/Mobile/DocumentViewController.mm:33

Interesting. Presumably in the -[AppDelegate application:openURL:options:] we should save (?) and close an existing document?
Comment 4 How can I remove my account? 2019-05-16 13:21:40 UTC
(I spent some days last week on this but could not yet come up with a working solution. Harder problem than expected.)
Comment 5 How can I remove my account? 2019-05-16 20:35:47 UTC
Created attachment 151470 [details]
WIP patch

(Just to not accidentally lose it, the work in progress (or, alternatively, misguided first attempt at fix) state from last week, with some refactoring and temporary additional debug output. The basic change here was to close the document and dismiss the DcumentViewController in the openURL method in AppDelegate.)
Comment 6 Nicolas Christener 2019-10-10 12:48:16 UTC
I can' reproducte this issue any more.

I tried with two *.docx files (as ODF files can't currently be edited in the Nextcloud iOS app - this is an other bug filled at Nextcloud as #968305, it's not a public bug tracker and part of the enterprise sub).

@AndreasGruhler: can you recheck?
Comment 7 Andreas Gruhler 2019-10-10 13:25:36 UTC
This is still reproducible when opening the a document with the **iOS app**. Currently, you can only reproduce this when opening two different files that can be opened with the iOS app, for instance .odp/.odt.

If you open a Microsoft document this will not be reproducible, since the document is opened in the webkit browser on the right-hand side (the "preview" area).

For clarification:
When you open any document with the **iOS app** from the Nextcloud app (e.g., open with..), two arrows appear on top left. The upper arrow is the one that is misbehaving for successive edits and the topic of this bug.

However, this might also be an issue which needs fixing in the Nextcloud app.

Please find a screenshot attached that highlights the back button in question.

Thanks
Comment 8 Andreas Gruhler 2019-10-10 13:29:37 UTC
Created attachment 154899 [details]
Back button which does not close the document
Comment 9 Andreas Gruhler 2019-10-10 13:30:59 UTC
I was just made aware that this button is only visible on larger iPads (like the iPad pro), but not on smaller devices.
Comment 10 Andreas Gruhler 2019-11-04 12:24:06 UTC

*** This bug has been marked as a duplicate of bug 128577 ***