cyanomiko / dcnnt-android

Android client for https://github.com/cyanomiko/dcnnt-py
MIT License
221 stars 6 forks source link

Downloading in file sync doesn't work #21

Open amjr108 opened 2 years ago

amjr108 commented 2 years ago

Server sends file list, client recieves it, but actual downloading doesn't happen.

Uploading works fine.

cyanomiko commented 2 years ago

Try to check files permission for app and download directory in settings. Some logs may be useful for debug too.

amjr108 commented 2 years ago

I've checked logs.

On my phone:

2022-07-21_09-24-24: Start 'dir' sync task 'Sync directory'
2022-07-21_09-24-24: Have 0 entries to sync
2022-07-21_09-24-24: Scheduled operations: rename - 0, delete - 0 create dirs - 0, upload to server - 0, download from server - 1

On my computer:

Enter plugin: "SyncPlugin"
[SyncPlugin] b'{"jsonrpc":"2.0","method":"dir_list","params":{"path":"\\/home\\/office\\/sync","mode":"download","on_conflict":"new","on_delete":"ignore","use_crc":false,"data":[]},"id":1}'
[SyncPlugin] <JSON-RPC 2.0 Request [1]: dir_list({'path': '/home/office/sync', 'mode': 'download', 'on_conflict': 'new', 'on_delete': 'ignore', 'use_crc': False, 'data': []})>
[SyncPlugin] Process 0 names, mode: "download", target: "/home/office/sync", on conflict: "new", on delete: "ignore"
[SyncPlugin] Created local FS flat data: 1 names
[SyncPlugin] Names compared: client only: 0, server only: 1, in conflict: 0
[SyncPlugin] Client only:
[SyncPlugin] Server only:
[SyncPlugin]     /testfile.txt
[SyncPlugin] In conflict:
[SyncPlugin] To upload from client to server:
[SyncPlugin] To download from server to client:
[SyncPlugin]     /testfile.txt
[SyncPlugin] To delete on client:
[SyncPlugin] To rename on client:
[SyncPlugin] Dirs to create on client:
[SyncPlugin] To delete on server:
[SyncPlugin] To rename on server:
[SyncPlugin] Dirs to create on server:
[SyncPlugin] Sent: {"jsonrpc": "2.0", "id": 1, "result": {"upload": [], "download": ["/testfile.txt"], "create": [], "delete": [], "rename": [], "session": "1658384587.6414366.140237376100352"}}
[SyncPlugin] None
[SyncPlugin] No more requests, stop handler
Exit plugin: "SyncPlugin"

So, operation is scheduled, but nothing happens.

cyanomiko commented 2 years ago

Added some fixes on server side (https://github.com/cyanomiko/dcnnt-py/commit/36394374dc6686ca3786226f0209c9f39e831535). Update available here: https://pypi.org/project/dcnnt/0.7.1/

amjr108 commented 2 years ago

Now working.

Thanks for the great app!

P.S. Also found that nested folders created with every sync:

For example on server there is:

dir1/dir2

On client after first sync:

dir1/dir2

On client after second sync:

dir1/dir2 dir1/dir2 (1)

And so on.

Also directory tree is flattened: dir1/dir2/dir3 becomes dir1/dir2_dir3. Files in dir3 aren't synced.