SimpleMobileTools / Simple-Notes

A simple textfield for adding quick notes without ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
826 stars 271 forks source link

Opening file from Nextcloud sync causes NetworkOnMainThreadException #619

Closed peterDSM closed 1 year ago

peterDSM commented 1 year ago

Hey. Thank you for the great set of apps. I love them and use nearly all of them.

As a user I want to be able to share a note (check list in my case) via Nextcloud with other family members. To achieve this I copy the list file to nextcloud sync folder. When opening the file from nextcloud folder I get a NetworkOnMainThreadException.

Not sure if this same issue also occurs for Dropbox and other sharing services or if this is Nextcloud specific behavior.

Steps to reproduce (App Version 6.15.4 Pro from FDroid, Android 13)

  1. Create new checklist in notes app
  2. Export checklist as file to nextlcoud share folder
  3. Remove checklist from notes app without deleting the file
  4. In notes app click "Open file" and select file in nexcloud share folder

This results in an NetworkOnMainThreadException.

Observation: The same file can be opened with Simple FileManager.

38 and #354 mention synchronizing on a file basis as a solution for cloud integration. However, in my case seems not to be working

tibbi commented 1 year ago

a proper error should be shown in 6.15.6

peterDSM commented 1 year ago

Hi @tibbi,

Do I understand it correctly that it is "as designed" or by restrictions of Android API that what I tried did not work?

tibbi commented 1 year ago

our app has no internet access, it cannot load online files

peterDSM commented 1 year ago

@tibbi I am not sure if I did not express clear enough what I am doing or if that is missing knowledge about the system on my side. I was talking about access to Android/media/com.nextcloud.client/nextcloud/[accountname] folder. I am not sure if internet permission is really required to access that. If I understand it correctly from permissions Simple File Manager also does not have internet access, correct? Because access from that app is working.

Excuse me if I am totally wrong here. I really don't know much about the android ecosystem.

tibbi commented 1 year ago

well, the exception was thrown by the system, not us. So the app is definitely trying to access the internet somehow.

peterDSM commented 1 year ago

Ok. Thank you very much for the clarification and sorry for the inconvenience.