android icon indicating copy to clipboard operation
android copied to clipboard

DNS or ARP Cache of Android App does not cleanup after changing networks

Open GVLLIFESTYLE opened this issue 3 years ago • 4 comments

Steps to reproduce

  1. Connect to wifi, where nextcloud servers dns is a local ip
  2. Use the nextcloud app
  3. deactivate wifi
  4. use cellular, where the nextcloud servers dns is a public ip, but the same dns as local
  5. App stopps working
  6. Only closing it through the android app manager will make it work again (normal closing not enough)
  7. Switching in the non function state back to wifi, where the old ip matches the dns makes the app work again

Expected behaviour

  • Like all other apps, it should cleanup the arp and dns cache and try to resolve again in case the ip is unreachable behind the dns

Actual behaviour

  • See above + ALL other nextcloud android apps which are connected the the main app behaive the same. I asume they use the main app to communicate or read the network details

Environment data

Android version: 12

Device model: Z Fold 2

Stock or customized system: Stock

Nextcloud app version: 3.20.3

Nextcloud server version: 24.0.2

Reverse proxy: apache2 with ssl

Logs

Sadly no logs at the server I dont know how to get logs at the android app

GVLLIFESTYLE avatar Jun 24 '22 06:06 GVLLIFESTYLE

That is interesting. We implement a custom DNS cache, but we explicitly clear it on network change (developer ref).

My only suspicion is that the system may not be sending the connectivity change broadcast to the app. Unfortunately I see no way to debug this right now as there are no related logs.

AlvaroBrey avatar Jun 27 '22 08:06 AlvaroBrey

Well it does work on ios. This problem happens at all my android 12 devices. S22 Ultra, Note 10 +, Z Fold 2, Galaxy Tab

If there would be a debug mode in the nextcloud android app which logs everything what happens I could attach logs, but as the app does not even contact my backend, cause the dns cache is wrong it can't get any logs.

Other apps on my android phone work without any issues, this happens just the nextcloud apps.

Can't you reproduce it with the steps I wrote??

How can I get logs for you guys now??

GVLLIFESTYLE avatar Jun 27 '22 10:06 GVLLIFESTYLE

My initial investigation seems to indicate that the DNScache is not being checked for non-SSL connections, so we don't have control there right now. Will need to investigate further.

AlvaroBrey avatar Jul 13 '22 13:07 AlvaroBrey

My environment is hosted with SSL enabled (https). But the problem still exists when switching between networks. The important thing is not to stop the app in between the switching but just let it run in the background and then change network and then switch back to the app and reload. This should be the easiest way to reproduce the problem.

GVLLIFESTYLE avatar Jul 21 '22 04:07 GVLLIFESTYLE

The issue is till persisting. Not only with Samsung Devices, but also with Nothing Phone 1. My Nextcloud Version: 26.0.1 App Version: 3.24.2 Android: Android 13

Any updates on that issue?

GVLLIFESTYLE avatar May 16 '23 09:05 GVLLIFESTYLE

That is interesting. We implement a custom DNS cache

Please remove the APP DNS Cache :-(

No Matter waht Android Version and waht Andriod Device. User is outside the Company Network, the NextcloudApp get the external IP Adress. The user comes back to the Company, connect to wifi, Nextcloudapp cant Uploade files ...

You have to forcekill the app and start the app again and thann the upload starts. It is annoying and the user mostly not able to do so by themself....

Funnything, only the uploade dont work, the access and browsing through the folders work....

thechonta avatar Jan 22 '24 14:01 thechonta