keepassium / KeePassium

KeePass-compatible password manager for iOS
https://keepassium.com
Other
1.2k stars 103 forks source link

MEGA.nz Files app integration #369

Closed kra-mo closed 5 months ago

kra-mo commented 5 months ago

Description Since the support page on the website was last updated, MEGA did add support for the iOS Files app. However, when using a file from there, local changes get pushed but no remote changes get pulled.

How to reproduce Steps to reproduce the behavior:

  1. Choose a file from MEGA
  2. Change something remotely
  3. The source is marked as unavailable
  4. Pick the file again
  5. The remote changes are still not visible

Environment:

keepassium commented 5 months ago

The source is marked as unavailable

Do you mean KeePassium shows that database file does not exist?

If so, this can happen if remote file is not updated (and retains the same internal ID) but rather re-created (with a new ID). In some cases, you might be able to fix this in desktop app's settings, as described in the linked article.

kra-mo commented 5 months ago

Yes, but even after re-adding the file, the changes are not reflected in KeePassium so I'm guessing there's something more going on here.

kra-mo commented 5 months ago

As in, it shows only the version added initially plus any changes made to it from within the app, nothing more.

kra-mo commented 5 months ago

My desktop client of choice also seems to save to the same file, not move files (which makes sense since it's sandboxed and can't create other files in the directory):

https://gitlab.gnome.org/World/secrets/-/blob/master/gsecrets/database_manager.py#L139

So it's not the issue.

kra-mo commented 5 months ago

This is also confirmed by the fact that if I use another provider to sync, the issue doesn't happen. So this is specific to the way MEGA handles their Files app integration.

keepassium commented 5 months ago

Yes, but even after re-adding the file, the changes are not reflected in KeePassium so I'm guessing there's something more going on here.

So this is specific to the way MEGA handles their Files app integration.

Hence the "manual sync only" status :)

This kind of issue, returning a cached file without updating it first, is quite a common problem among smaller storage providers. Nextcloud, Synology Drive, QNAP File, Mega all manifest it at some point. The reason why this happens is described in the FAQ of Möbius Sync:

Apple iOS restricts apps from running continuously in the background, but apps can run for short times sporadically. Möbius Sync uses various methods to invoke background behaviour. The minimum interval between quick syncs and power syncs can be configured under Settings, but iOS schedules background activity in an adaptive manner that is not predicatable and sometimes counter-intuitive. It may take 24 hours to start to sync but you can expect a total of 1-2h of sync activity per day once stable

One way or another, this is not KeePassium's issue and we cannot do much about it.

The one thing we can do is to go around Files app integration altogether and sync directly with the remote service. We did this with OneDrive and it solved 100% of sync issues. It just works. There is an upcoming support for Dropbox and Google Drive. Direct support for other services will depend on their scale and demand.

But again, Mega's File integration does not work, it is their issue, we cannot do anything about it besides the already written "manual sync only" recommendation.

kra-mo commented 5 months ago

Huh, you're right. Testing with a text file, that is how it works. Even after opening the file in the app, the version in the Files app does not update. Very unfortunate.

Thanks for the support, a MEGA sync provider would be appreciated as it's the only cloud provider with a proper first-party sync client on Linux.