laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
45.17k stars 4.91k forks source link

Android - Synchronizing - note indexing freezes the UI (UI not updating) #9379

Closed slawekmikula closed 6 months ago

slawekmikula commented 9 months ago

Operating system

Android

Joplin version

2.12.3

Desktop version info

Occured on 2.12.6 and tested/verified on latest dev (git) version.

Current behaviour

Have a lots of notes (1500) and many more attachments (screens, images) - more than 6000. Migration from the evernote. Migrated through Linux application. On the Linux desktop everything works OK. Created synchronization through webdav (nextsync/owncloud) and successfully synchronize the data from the desktop to owncloud (sync working for some time).

Installed Android application. Create synchronization and options to above owncloud server. First sync synchronization successful on Android device. Next synchronization freezes the application (and it is persistent for each consecutive run).

Expected behaviour

Application should synchronize and do not freeze the UI.

I've compiled the application from the source and run on the android device/emulator. Problem is when the application enters the note indexing state before the sync:

 INFO  21:06:10: Synchronizer: Indexing resources...
 INFO  21:06:10: ResourceService::indexNoteResources: Start

During the indexing, the UI is not refreshed. Indexing in the main thread (?). Because the notes and attachments are very large in quantity the indexing took a very long time (another issue, maybe this can be speed up a bit). On Samsung S20 FE (Snapdragon 865) it freezes the UI and the Joplin was unresponsive.

When I knew what the problem is, i've synchronized only notes (with attachments marked as manual) and put the Joplin process in the performance mode without energy saving. After that the indexing finished successfully and the application is now (on this device) accessible and synchronization is working again.

After first indexing (which takes a lot of time) the application on next sync's is making a lot better experience, although there is visible UI freeze (arrows stops rotating) for ca 0,5-1 second.

Anyway - the indexing should not block the UI and maybe send some note to the user e.g. "Note indexing" message. Maybe on the first indexing there should be a note (popup) with information that it could take a lot of time.

In the log section there is also one exception not connected with this issue, but reporting it anyway. It appears when the toolbar/shelf appears (but not sure of the origin).

Logs

INFO  21:06:10: Synchronizer: Sync: starting: Starting synchronisation to target 5... supportsAccurateTimestamp = false; supportsMultiPut = false [1700942770067]
 WARN  Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false` 
    at SideMenuContentComponent (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:599483:14)
    at Connect(SideMenuContentComponent) (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:598005:43)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:46087:43)
    at JoplinSafeAreaView (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:594428:24)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:46087:43)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:46087:43)
    at SideMenuComponent (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:661850:78)
    at Connect(SideMenuComponent) (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:598005:43)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:46087:43)
    at ThemeProvider (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:609192:38)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:46087:43)
    at Portal.Host (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:616622:36)
    at RNCSafeAreaProvider
    at SafeAreaProvider (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:609701:24)
    at SafeAreaProviderCompat (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:609600:25)
    at PaperProvider (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:609493:37)
    at AppComponent (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:100685:79)
    at Connect(AppComponent) (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:598005:43)
    at Provider (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:597584:21)
    at Root (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:101081:79)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:46087:43)
    at RCTView
    at View (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:46087:43)
    at AppContainer (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:45968:36)
    at Joplin(RootComponent) (http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=net.cozic.joplin&modulesOnly=false&runModule=true:83977:28)
 INFO  21:06:10: Synchronizer: Indexing resources...
 INFO  21:06:10: ResourceService::indexNoteResources: Start
slawekmikula commented 9 months ago

As requested on the forum (https://discourse.joplinapp.org/t/android-freeze-when-syncing-start/33621). Logs.

Application running correctly (next sync after 1-2 sync). correct.txt

Cleared application data (android). Defined sync channel (nextcould).

First synchronization first.txt

Screen after first synchronization: first_finished

Second synchronization. second.txt

During this operation the interface was freezed. Cannot click on anything. Sync arrow wasn't animating.

second_ongoing

github-actions[bot] commented 8 months ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

savva777 commented 8 months ago

I have the same issue for Pixel7 Androi13, synchronization of large Evernote backup via Dropbox. Version of Joplin is 2.13.10.

github-actions[bot] commented 7 months ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

github-actions[bot] commented 6 months ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

github-actions[bot] commented 6 months ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, feel free to create a new issue with up-to-date information.

nonobio commented 1 month ago

Hi :slight_smile:

I also have this issue: the application is frozen during synchronization which lasts around a minute, when the sync is finished I can use the application without problem.

I found this comment from Laurent which could be the explanation:

With WebDAV it's to be expected since the app needs to parse a giant XML file at the beginning of each sync and this can freeze the app. This is unfortunately the only way to compare what's on the phone and what's on the server, since WebDAV doesn't support delta sync like Joplin Server or Dropbox

Is this still relevant and inevitable?

Here is my Android sync status:

image

Details

Joplin 3.0.8 (prod, android) ID client : 00e4980240cc4ce2ac3ccc062b12dd7f Version de Synchro : 3 Version du profil : 47 Trousseau supporté : Non Niveau d'API Android : 34 Version WebView : 125.0.6422.165 Package WebView : com.android.webview FTS activé : 1 Hermes activé : 1

Thanks :)

nonobio commented 1 month ago

Hi, I spoke with @personalizedrefrigerator who thinks that @laurent22's comment is still relevant but he still finds that the freeze that I have lasts a long time.

I made a video of the problem: https://youtu.be/3EqV0YT5ajs

If this is really the normal behavior with synchronization via WebDAV and there is nothing to do, too bad, I think I can live with it, for example by remembering to deactivate Wifi before opening Joplin when I just want to quickly look at a note.

But tell me if this seems unusual to you and you thin there is an issue, I can give you additional information if necessary.

Thanks :)