Can't write files into Nextcloud
- Create a new .org file in the NextCloud app.
- Open it with orgro.
- Write something and save.
- The file remains empty.
orgro 1.45.2, iOS 18.1, Nextcloud 6.1.1 on Server 29.0.4.
- Write something and save.
- The file remains empty.
Can you be more specific about what you are doing and seeing?
I tried reproducing with your environment and found that I couldn't even create a file in Nextcloud—creating the blank file failed:
Trying with a different provider (Dropbox) I found that what happened was:
- Tap Open to choose the save location
- Orgro opens two editor views on top of each other, so quickly that it's hard to see (this is a bug)
- Enter text and tap the ✔︎ in the upper right to save
- The topmost editor closes, leaving the bottom, blank editor still open. Meanwhile, the "Saved" snackbar will appear after a few seconds as Orgro correctly saves what you entered into the first editor.
- Tap the × to close the second editor without saving
- The file content from no. 3 above is shown correctly
If this correctly describes your issue, then I have identified the cause and will release a fix soon. If not, please give more detail.
Can you be more specific about what you are doing and seeing?
I noticed that I can't create a new file in Nextcloud from your app (an error appears), so I thought I could use it to edit existing org files instead. Editing an existing org file in Nextcloud seems to work, said snackbar appears, but when I open the "saved" file in the Nextcloud app afterwards, it is still empty.
OK, thanks, what I described is a different bug, then. It will be fixed in v1.45.3.
I can reproduce your issue as well.
- I don't see any errors when I run in debug mode
- Other apps like Dropbox and Working Copy do accept writes correctly
- Yet other apps like Google Drive show the same issue with writes not "sticking"
Orgro is doing the same thing regardless of source app, so the fact that it works with some and not others indicates to me that it's a problem with the source app. I don't think there's anything I can do about it.
If there is another app that can access files in the same way as Orgro (via the File Provider API) that can successfully write to Nextcloud or Google Drive files, then that would indicate a problem with Orgro. I will have to see if I can find such an app.
Orgro is doing the same thing regardless of source app, so the fact that it works with some and not others indicates to me that it's a problem with the source app. I don't think there's anything I can do about it.
Looks like you might be correct here:
https://github.com/nextcloud/ios/issues/3125
I'll leave this open for verification if you wish / close as you please. Sorry!
Nice find! Thanks for that. Let's keep this open as a tracker.
Related to this:
I'm on Android, when I try opening an Org document in my Nextcloud folder, it gives the error below. When I try and open an Org document from the default Android file manager, it doesn't open, I just get brought to the app's start page.
Related to this:
But not actually related, because this ticket is about being unable to write into Nextcloud. It would have been better to open a new ticket.
The error shown in your screenshot happens when the file returned by Nextcloud can't be accessed. I was able to reproduce it by selecting a Nextcloud file that had never been accessed locally, while my internet was off. (On the other hand, a file that has been accessed at least once should open with a toast saying "File could not be synced. Showing latest available version.")
There is nothing Orgro can do about Nextcloud failing to provide a file. Maybe your internet was unavailable, or the Nextcloud server was unavailable, or the Nextcloud app is buggy?
Log when failing to load Nextcloud document
D/FilePickerWritable(25627): Got method call: openFilePicker
D/FilePickerWritable(25627): onActivityResult(40832, -1, content://org.nextcloud.documents/document/e9c4cf00cc8b38b21e556090d9a00c24%2F11)
D/FilePickerWritable(25627): Got result content://org.nextcloud.documents/document/e9c4cf00cc8b38b21e556090d9a00c24%2F11
D/FilePickerWritable(25627): Copy file content://org.nextcloud.documents/document/e9c4cf00cc8b38b21e556090d9a00c24%2F11 to /data/user/0/com.madlonkay.orgro.debug/cache/Readme.md6971996295470536597.tmp
D/FilePickerWritable(25627): Error during handling file picker result.
D/FilePickerWritable(25627): java.io.FileNotFoundException: Error downloading file: Readme.md
D/FilePickerWritable(25627): at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151)
D/FilePickerWritable(25627): at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:781)
D/FilePickerWritable(25627): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1983)
D/FilePickerWritable(25627): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1798)
D/FilePickerWritable(25627): at android.content.ContentResolver.openInputStream(ContentResolver.java:1475)
D/FilePickerWritable(25627): at codeux.design.filepicker.file_picker_writable.FilePickerWritableImpl$copyContentUriAndReturnFileInfo$2.invokeSuspend(FilePickerWritableImpl.kt:373)
D/FilePickerWritable(25627): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
D/FilePickerWritable(25627): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
D/FilePickerWritable(25627): at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
D/FilePickerWritable(25627): at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
D/FilePickerWritable(25627): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
D/FilePickerWritable(25627): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
D/FilePickerWritable(25627): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
D/FilePickerWritable(25627): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
When I try and open an Org document from the default Android file manager, it doesn't open, I just get brought to the app's start page.
I can't reproduce this. On my Pixel 2, opening a file from the Internal Storage or Documents section of the Files by Google app results in the file opening in Orgro.
I don't think there's much I can do without having your exact device to test with, but please provide:
- Your Android version
- The device model
- The exact file manager app you're using
The error shown in your screenshot happens when the file returned by Nextcloud can't be accessed. I was able to reproduce it by selecting a Nextcloud file that had never been accessed locally, while my internet was off. (On the other hand, a file that has been accessed at least once should open with a toast saying "File could not be synced. Showing latest available version.")
Hmm, I think that's it. I expected the mobile app to act like the desktop client, where it downloads everything and you can access it immediately, but it looks like it doesn't do that. My Nextcloud has been disconnected for a while, hence trying to open a file doesn't work.
When I try and open an Org document from the default Android file manager, it doesn't open, I just get brought to the app's start page.
I can't reproduce this. On my Pixel 2, opening a file from the Internal Storage or Documents section of the Files by Google app results in the file opening in Orgro.
Sorry, I meant to say opening an Org document from the Nextcloud folder would bring me to the app's start page. But I suspect it's the same issue as above.
Anyway, my apologies for the noise!