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

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

Open
daudo opened this issue Jun 18, 2024 · 14 comments
Open

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

daudo opened this issue Jun 18, 2024 · 14 comments
Labels

Comments

@daudo
Copy link

daudo commented Jun 18, 2024

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.

@zhwanng
Copy link
Contributor

zhwanng commented Jul 1, 2024

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

@daudo
Copy link
Author

daudo commented Aug 4, 2024

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.

@TheKeyLimePie
Copy link

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.

@zhwanng zhwanng added the bug label Jan 20, 2025
@Leosirth
Copy link

Hi,

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

Thanks,

@zhwanng
Copy link
Contributor

zhwanng commented Jan 26, 2025

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
Copy link
Contributor

zhwanng commented Feb 11, 2025

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

@TheKeyLimePie
Copy link

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.

@zhwanng
Copy link
Contributor

zhwanng commented Feb 11, 2025

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?

@TheKeyLimePie
Copy link

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.

@moobyfr
Copy link

moobyfr commented Feb 19, 2025

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
Copy link

moobyfr commented Feb 19, 2025

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);

int accessMode = ParcelFileDescriptor.parseMode(mode);

Which throws the exception UnsupportedOperationException

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

@Leosirth
Copy link

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,

@moobyfr
Copy link

moobyfr commented Mar 1, 2025

I've tried the 3.0.7 version, it seems that some code was added to handle write on the file!
The test with keepassxc seems to be ok for me!

@TheKeyLimePie
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants