seadroid icon indicating copy to clipboard operation
seadroid copied to clipboard

[3.0.0] from fdroid: on the fly document editing does not work anymore

Open daudo opened this issue 1 year ago • 35 comments

My seafile instance hosts a number of keepassxc password files.

Using the stable 2.x android version, what I can do is to open the seafile app on my phone/tablet, navigate to a keepass file and open it with keepassxc. I can then do any changes, add new entries, edit existing ones and save the updated values. The modified keepassfile then gets uploaded automatically.

With the 3.0.0 version from fdroid, this works sometimes, but mostly not, the changed keepass files on my phone just doesn't get uploaded to the server. Instead I see a "Backup folder Uploading" notification, see the attached screenshot. Nothing happens actually, the transfer list in he app is empty and the notification stays there until I forcibly terminate the seafile app.

folder_uploading

"Folder Backup" has not been turned on in the app though.

folder_backup

Because if this, I have to effectively revert back to the old 2.x version.

If there's anything more I can do, please let me know.

daudo avatar Jun 18 '24 08:06 daudo

Please update to v3.0.1-beta and try it again

zhwanng avatar Jul 01 '24 06:07 zhwanng

I just tried with v3.0.2-pre and unfortunately it still doesn't work, the updated file gets never synchronized to the seafile server.

daudo avatar Aug 04 '24 19:08 daudo

I'm joining this thread here in hope that this issue gets more attention to the developers.

I've experienced the same behaviour in combination with Excel on Android running Seafile Client v3.0.7 / Server v12.0.7 when editing spreadsheets. I'm opening an Excel file in the Excel app using Android's native file browser where Seafile is listed as a dedicated source. After editing, I'm trying to close the spreadsheet but saving does not succeed. Instead, Excel's close&save dialog gets stuck.

This workflow used to work in older versions of the Seafile client. This is really bugging me. A fancy new UI is not conducive to anyone if basic file tasks get completely broken along the way.

TheKeyLimePie avatar Jan 19 '25 13:01 TheKeyLimePie

Hi,

I have the same problem here; running the latest 3.0.7 and it's not working since 3.x

Thanks,

Leosirth avatar Jan 24 '25 12:01 Leosirth

Hi,

I have the same problem here; running the latest 3.0.7 and it's not working since 3.x

Thanks,

please wait a new release

zhwanng avatar Jan 26 '25 10:01 zhwanng

Seadroid has released a new release, can you retest it?

zhwanng avatar Feb 11 '25 08:02 zhwanng

The update to v3.0.8 doesn't seem to fix my bug editing files hosted on Seafile with the Excel app. The error pattern remains the same.

TheKeyLimePie avatar Feb 11 '25 08:02 TheKeyLimePie

The update to v3.0.8 doesn't seem to fix my bug editing files hosted on Seafile with the Excel app. The error pattern remains the same.

What app was used to edit the Excel file?

zhwanng avatar Feb 11 '25 09:02 zhwanng

It's the official Microsoft Excel app (v16.0.18526.20030).

  • Start the App
  • Click "Open" in the bottom right corner
  • Select the browse option with the cloud icon
  • With the system's file dialog opening up, select the Seafile source and browse to the Excel file
  • Edit something
  • Close the app (either the back icon on the top left corner, or by pressing the phone's back button) which triggers the "Closing..." processing dialog.

In previous versions of the Seafile app, the save process succeeded here.

TheKeyLimePie avatar Feb 11 '25 10:02 TheKeyLimePie

3.0.8 doesn't fix the bug for keepassxc for me :/

Here the current sniplet from logcat

02-19 08:51:12.896 15547  9447 D KP2A    : content://MDP.kdbx localVersionHash = C0D986B3FA7925D05E5B17AC0F695BB2419CDD9AFC673C8A0A4E8134C9B7B52E
02-19 08:51:12.913 15547  9447 D KP2A    : content://MDP.kdbx baseVersionHash = B97740ED7F33FACE98A9CE18B5F385C0D017CB497AEA26239CA39FE7DB3191BF
02-19 08:51:12.918 15547  9447 D KP2A    : status message: Enregistrement de la base de données…
02-19 08:51:16.390 15547  9454 D KP2A    : couldn't save to remote content://com.seafile.seadroid2.documents/document/seafile.XXX/YYY/MDP.kdbx
02-19 08:51:16.395 15547  9454 D KP2A    : Java.Lang.UnsupportedOperationException: Exception of type 'Java.Lang.UnsupportedOperationException' was thrown.
02-19 08:51:16.395 15547  9454 D KP2A    :   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008e] in <5b54a83ca83746088021e5b1e5efb5bd>:0 
02-19 08:51:16.395 15547  9454 D KP2A    :   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002f] in <5b54a83ca83746088021e5b1e5efb5bd>:0 
02-19 08:51:16.395 15547  9454 D KP2A    :   at Android.Content.ContentResolver.OpenFileDescriptor (Android.Net.Uri uri, System.String mode) [0x0004b] in <abeccd3d07064d9fb2804b3661985a17>:0 
02-19 08:51:16.395 15547  9454 D KP2A    :   at keepass2android.Io.AndroidContentWriteTransaction.CommitWrite () [0x00016] in <dc3b7006f1a749e7b86383f811962f2f>:0 
02-19 08:51:16.395 15547  9454 D KP2A    :   at keepass2android.Io.CachingFileStorage.UpdateRemoteFile (System.IO.Stream cachedData, KeePassLib.Serialization.IOConnectionInfo ioc, System.Boolean useFileTransaction, System.String hash) [0x00022] in <dc3b7006f1a749e7b86383f811962f2f>:0 
02-19 08:51:16.395 15547  9454 D KP2A    :   at keepass2android.Io.CachingFileStorage.TryUpdateRemoteFile (System.IO.Stream cachedData, KeePassLib.Serialization.IOConnectionInfo ioc, System.Boolean useFileTransaction, System.String hash) [0x00000] in <dc3b7006f1a749e7b86383f811962f2f>:0 
02-19 08:51:16.395 15547  9454 D KP2A    :   --- End of managed Java.Lang.UnsupportedOperationException stack trace ---
02-19 08:51:16.395 15547  9454 D KP2A    : java.lang.UnsupportedOperationException
02-19 08:51:16.395 15547  9454 D KP2A    : 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:174)
02-19 08:51:16.395 15547  9454 D KP2A    : 	at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:153)
02-19 08:51:16.395 15547  9454 D KP2A    : 	at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:759)
02-19 08:51:16.395 15547  9454 D KP2A    : 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1876)
02-19 08:51:16.395 15547  9454 D KP2A    : 	at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:1689)
02-19 08:51:16.395 15547  9454 D KP2A    : 	at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:1635)
02-19 08:51:16.395 15547  9454 D KP2A    : 	at mono.java.lang.RunnableImplementor.n_run(Native Method)
02-19 08:51:16.395 15547  9454 D KP2A    : 	at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31)
02-19 08:51:16.395 15547  9454 D KP2A    : 	at java.lang.Thread.run(Thread.java:1012)

moobyfr avatar Feb 19 '25 07:02 moobyfr

Here my current analysis:

In keepass, the following code fails: ParcelFileDescriptor fileDescriptor = _ctx.ContentResolver.OpenFileDescriptor(Android.Net.Uri.Parse(_path), "rwt"); (https://github.com/PhilippC/keepass2android/blob/82fedb3526ccd1bf184648ebdf2acf329550ef60/src/Kp2aBusinessLogic/Io/AndroidContentStorage.cs#L319) It's the method which will write the file. The mode asked by keepass2android is rwt

In seadroid2, this operation is managed with openDocument from SeafileProvider.java: public ParcelFileDescriptor openDocument(final String documentId, final String mode, final CancellationSignal signal) throws FileNotFoundException {

The mode is inspected by int accessMode = ParcelFileDescriptor.parseMode(mode); https://github.com/haiwen/seadroid/blob/8d1b070db573058916e30ca5a01d3dbaaa0d8e8d/app/src/main/java/com/seafile/seadroid2/provider/SeafileProvider.java#L422

Which throws the exception UnsupportedOperationException

So, the question is : how can seadroid2 write files , if it's only not suported ??

moobyfr avatar Feb 19 '25 09:02 moobyfr

Just to add that I have the same issue with keepass but I'm using a different application: KeepassDX

With the previous major version 2.x this was working fine, but since 3.x this is broken.

Another difference that I see from the previous version is that when opening the file in KeepassDX from Seafile, with version 2.x the file was loaded on the fly from the seafile server; while from version 3.x the file looks like is loaded from a cache since it doesn't get it from the seafile server (indeed the file is not updated to the latest version). Probably this is the reason since also the file save is not reflected in the seafile server.

Thanks,

Leosirth avatar Feb 19 '25 09:02 Leosirth

Running version 3.0.9 and file changes are still not pushed to Seafile. After the file has been edited in Android/media/com.seafile.seadroid2./[user profile]/[library]/somefile, it won't trigger a file upload back to the server. I have to wipe this folder, reopen/-download the file, make my changes and then it eventually pushes the new file to the server.

TheKeyLimePie avatar Mar 03 '25 11:03 TheKeyLimePie

the v3.0.11 in the github releases has improved this feature.

zhwanng avatar Apr 29 '25 09:04 zhwanng

Version 3.0.11 still does not fix the back-sync issue. Following the steps mentioned above (starting with no local files in Android/media/com.seafile.seadroid2./[user profile]/[library]/), the changed file then won't be uploaded to the server. The modified file is saved in that local directory, but the Seafile app won't even recognize the local file version (orange tick icon under the file name entry).

TheKeyLimePie avatar May 02 '25 08:05 TheKeyLimePie

Confirmed with KeepassXC, the file is updated locally but isn't uploaded

moobyfr avatar May 02 '25 11:05 moobyfr

There are two ways to open a kdbx file.

First, click on the kdbx file in Seafile, and use the KeePassDX app to open it after the download is complete.

Second, use the KeePassDX app to open the kdbx file in your local folder directly. However, if the local file has already been backed up, it will not be uploaded again even if the content changes.

Has anyone encountered a situation where things don't work properly when using the first way?

zhwanng avatar May 07 '25 08:05 zhwanng

I've tried KeepassDX as I never used it. I followed the first way: open seafile, click on kdbx, and open it with keepassdx. Adding a item in keepassDX and saving it -> There is no upload of the modified file to the seafile server. Note that I can open the kdbx file with keepassxc and see the changes locally!

moobyfr avatar May 07 '25 12:05 moobyfr

I just tried it again both ways (start with the seafile app and open the kbdx file from there and also open the file from the KeepassDX file chooser), and unfortunately it still doesn't work.

Just to rule out an issue with KeepassDX, I made a very simple test with a plain text file. I uploaded it to Seafile from my workstation and as expected, it showed up in the Seafile app on my Android device:

Image

When clicking on it, a text editor opens immediately (not sure which one - does have Seafile a simple built-in text editor)?

Image

After editing the file and saving the changes, nothing happens, the timestamp shown for the file in the Seafile Android app doesn't update and nothing is uploaded to the Seafile server. The funny thing is however, that if I open the same file again from the Seafile app, it opens the file with the changes I've made.

daudo avatar May 07 '25 14:05 daudo

@daudo 1、Yes, Seafile does have a simple built-in text editor. 2、The app just released v3.0.12 on GitHub Releases, and has added debug-level logs. could you reinstall it to test this feature and check the contents of the log file in "/sdcard/Android/data/com.seafile.seadroid2/files/logs"?

zhwanng avatar May 09 '25 03:05 zhwanng

I've upgraded my seafile, I have some more debug available at : https://secrets.cebador.fr/?7a4b9182b29976a2#5eJpDYFbtUEijQVZHBcRKhRX8YrTSymxarxGJ2pRJ4AH

But I don't see anything related to a upload try

moobyfr avatar May 09 '25 08:05 moobyfr

I've upgraded my seafile, I have some more debug available at : https://secrets.cebador.fr/?7a4b9182b29976a2#5eJpDYFbtUEijQVZHBcRKhRX8YrTSymxarxGJ2pRJ4AH

But I don't see anything related to a upload try

I've analyzed the log contents, and I'm guessing that maybe need to re-download this file (long-press and click the download button) and then edit the contents of this file through a third-party app to see if it uploads automatically.

zhwanng avatar May 09 '25 08:05 zhwanng

In seafile, I pressed the file to select it and download it. it is marked with the green check. Now, editing it through an external app makes it sync correctly. It seems that opening a file a with via the cloud manager (file ->cloud repertories, where we can find google drive and seafile), should download it first in seafile to make the sync work correctly.

moobyfr avatar May 09 '25 11:05 moobyfr

Understood. thank you for bringing this to our attention. we have identified the root cause of the issue and will resolve it in the upcoming release.

zhwanng avatar May 09 '25 12:05 zhwanng

Thanks so much for having opened this issue @daudo . I can confirm serious issues since the installation of seadroid 3.x on Android. Uploading and file editing does NOT work anymore since. Desktop apps (Windows and Linux) still successfully worked as expected.

First I suspected a problem with my own self-hosted Seafile CE server. It was still running on 9.x. Maybe the Android app requires an updated Seafile server? I upgraded to Seafile CE 10.x: Still can't upload or edit anything Upgraded to Seafile CE 11.x: Still can't upload or edit anything

Then I stumbled across this issue and manually installed an older APK (v 2.3.7 https://github.com/haiwen/seadroid/releases/tag/2.3.7) and HEUREKA!!! uploads are working again!

Unfortunately I only discovered this issue today. In the meantime my wife has lost so much data when she edited important files on her phone and they were never synced back to Seafile because of the self-updated Android app.

Napsty avatar May 24 '25 08:05 Napsty

Running version 3.0.13 and for a short period of time the app does upload changes from the local file, but after some hours or let's say after a day, the app seems to lose track of the file and any local changes continue to be unnoticed, even though the Seafile app shows the file as locally available. You then end up with deleting the local file instance, wiping the app's cache and redo everything you've done on the local file with a redownloaded file version.

At this point you start to develop a level of paranoia where you check the file timestamp in the Seafile app every time you've edited the file just to be sure that everything is in-sync.

It's just a buggy mess with the current major release. It's been several months now where the app is so unreliable and makes me re-evaluate the usage of Seafile when essential functionalities of a file management system are just not working.

TheKeyLimePie avatar May 24 '25 09:05 TheKeyLimePie

@TheKeyLimePie If possible, could you provide the log file? the logs can be found at the following path: ‘/sdcard/Android/data/com.seafile.seadroid2/files/logs/’. Alternatively, you can briefly describe how you handled the file — I mean how you opened, edited, and saved it.

zhwanng avatar May 24 '25 10:05 zhwanng

Log files aren't available to me in /storage/emulated/0/Android/data, it's completely empty or I don't have the proper read permissions (Google Pixel running Android 15, unrooted).

My use case is the same as mentioned earlier. I open the file using the system's file browser dialog, selecting Seafile as the external data source in the beginning. I then edit the file and the local copy is stored in Seafile's local media directory. When saving the file with Excel I also get a short Seafile toast message with "Updated" shortly after this and the server gets the new file. But after some time it doesn't notice any further changes on this file: The local file copy gets edited again and the modified timestamp is being updated in the media directory as I can tell from Android's file browser, but no toast message appears anymore and no upload to the Seafile server has been done, even when I'm opening the Seafile app again in hope to trigger some rescanning.

Edit: Tested it again. After about 2 hours, it didn't sync anymore. The local file is edited but the Seafile app won't recognise this change even after opening the app again.

TheKeyLimePie avatar May 24 '25 10:05 TheKeyLimePie

@TheKeyLimePie We have released v3.0.14, fixed some bugs and added some features, can you retest this issue, if it doesn't work as expected, please export the logs on the settings page.

zhwanng avatar May 30 '25 10:05 zhwanng

Running version 3.0.14 and after one day of testing I haven't experienced this bug again so far. Looks good 👍

TheKeyLimePie avatar May 31 '25 11:05 TheKeyLimePie