syncthing-android icon indicating copy to clipboard operation
syncthing-android copied to clipboard

Syncthing Android not detecting changes

Open DocMAX opened this issue 5 years ago • 5 comments

I set my /storage/emulated/0/DCIM/Camera as a folder with detect changes ON. But whenever i do photos/videos with the camera it doesn't detect the changes. Only on Syncthing restart.

Version Information

App Version: 1.1.4
Syncthing Version: v1.1.4
Android Version: Android 7.1.2 / Cyanogenmod 14

DocMAX avatar Jun 29 '19 10:06 DocMAX

Hi, Could you try to get logs from SyncthingNative please? (Logcat, Support bundle, enabling fs watcher debug facilities maybe) Another recommendation would be to upgrade Android to 8.1+ Lineageos, if you don't exactly need 7.1.2. Kind regards Catfriend1

Catfriend1 avatar Jun 30 '19 11:06 Catfriend1

I'm having the same issue (#1606). How could I go about debugging that? (I'm on Android 11.)

mdeff avatar Feb 10 '21 12:02 mdeff

Hi, I am having this problem as well, and can reproduce it reliably.

SUMMARY: I have two folders sync'd on my Android: Camera and Pictures. If i take a photo with the default camera app on my Pixel 5, syncthing doesn't react to the new file under any circumstances. Not if it's running, not if it's in the background. It doesn't sometimes work, it never works. The only way to get the photo to my other devices is a manual scan or hourly scan. However, if I move a file into Pictures, it notices the file from the filesystem reliably, and syncs to my other devices within 10 seconds. So the problem seems related to the Camera folder maybe?

VERSION INFO: Local device: Google Pixel 5, Android 11 RQ2A.210305.006 Local syncthing: v1.23.6 android (64-bit ARM) ("Fermium Flea") Remote device: MacOS 12.6.2 Remote syncthing: v1.23.6, macOS (64-bit ARM) ("Fermium Flea")

STEPS TO REPRODUCE:

  • Create a two-way sync folder for Camera (/storage/emulated/0/DCIM/Camera)
  • Launch syncthing Android
  • Note that it says "Up to date"
  • Switch to the default camera app
  • Take a photo
  • Switch back to syncthing
  • Note that it still says "Up to date", but no bytes transferred
  • Note that remote macOS device has not received the new photo
  • On android, tap "Rescan all"
  • Note that after a few seconds, photo is transferred

LOGCAT: Please find attached two logcats:

#1 - in synthing-camera-logcat-fail.txt, you'll see that around 08-08 07:54 I took a photo with the camera app. Syncthing doesn't sync until I tap "rescan all" manually.

#2 - in synthing-camera-logcat-success.txt, you can see that i moved a file into the Pictures folder (which is also watched by syncthing) and it immediately notices. So maybe it's something special with the DCIM folder?

Thanks for anything you can do to help!

ABOUT VERSION: Yes A11 is old. I don't like supporting old stuff either. But unfortunately I cannot upgrade it because of my job, so I'll need a solution that doesn't require platform software changes or rooting. Note that Android 11- is still over 25% of Android devices so it seems to me that it's worth supporting. Thanks for your consideration! synthing-camera-logcat-fail.txt synthing-camera-logcat-success.txt

zerotrickpony avatar Aug 08 '23 15:08 zerotrickpony

So the problem seems related to the Camera folder maybe?

It could also be related to the default camera app and its way of saving files to the Camera folder. Could you try using a 3rd party app (e.g. Open Camera) and see if the problem persist there?

tomasz1986 avatar Aug 08 '23 16:08 tomasz1986

Good idea, I just tested this. Open Camera (once configured to write to DCIM/Camera) has the same problem --- writing to the Camera folder does not cause syncthing to notice the file. However, if I use the "Files" app to move a photo into the Camera folder, then yes it does notice. So that would suggest that it's not the folder, it's the way the photo is written by the camera.

One other result:

The OpenCamera app has a checkbox for "Use Storage Access Framework". If i turn that on and take a photo, then syncthing DOES see it and sync it. I don't know what SAF is but apparently apps that manipulate the filesystem using SAF do work correctly.

Interestingly, the Camera folder had a second photo in there which syncthing hadn't seen yet. Even after the SAF photo DID sync, the prior photo still DIDNT sync. I guess that suggests that when syncthing gets the filesystem watch notification, it only reacts to the files mentioned and doesn't rescan. Perfectly reasonable just confirming the behavior empirically.

zerotrickpony avatar Aug 08 '23 17:08 zerotrickpony