GooBox / goobox-sync-storj

Sync app for Storj
GNU General Public License v3.0
3 stars 1 forks source link

Some files are syncing but sync state is idle #114

Closed jkawamoto closed 6 years ago

jkawamoto commented 6 years ago

I edited StorjOverlayIconProvider as follows so that it outputs logs:

public class StorjOverlayIconProvider implements OverlayIconProvider {

    private static final Logger logger = LoggerFactory.getLogger(StorjOverlayIconProvider.class);

    @Override
    public OverlayIcon getIcon(Path path) {
        SyncFile file = DB.get(path);
        OverlayIcon res;
        if (file == null || file.getState().isPending()) {
            res = OverlayIcon.SYNCING;
        } else if (file.getState().isSynced()) {
            res = OverlayIcon.OK;
        } else if (file.getState().isFailed()) {
            res = OverlayIcon.ERROR;
        } else {
            res = OverlayIcon.WARNING;
        }
        logger.debug("getIcon({}) = {}", path, res);
        return res;
    }

}

From the log, there were some syncing files:

[01:46:11.575] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/release) = OK
[01:46:11.577] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/README.md) = OK
[01:46:11.579] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/somefile) = OK
[01:46:11.581] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/random.txt) = OK
[01:46:11.583] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/another) = OK
[01:46:11.585] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/another/.DS_Store) = SYNCING
[01:46:11.586] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/another/Makefile) = OK
[01:46:11.588] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/another/log.txt) = SYNCING
[01:46:11.589] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/another/.DS_Store) = SYNCING
[01:46:11.591] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/another/Makefile) = OK
[01:46:11.594] [verbose] [nioEventLoopGroup-2-1] DEBUG i.g.s.s.o.StorjOverlayIconProvider - getIcon(/Users/junpei/Goobox/another/log.txt) = SYNCING

but a syncState command with idle was sent:

[01:46:12.334] [verbose] [Thread-1] DEBUG io.goobox.sync.storj.ipc.IpcExecutor - Command sent: {"method":"syncState","args":{"newState":"idle"}}
kaloyan-raev commented 6 years ago

.DS_Store is system file (excluded from sync). They should be no icon for it. It's a bug in the overlay icon provider to return SYNCING.

So, it's left to check the issue with log.txt. @jkawamoto could you provide the list_db output when this state occurs?

jkawamoto commented 6 years ago

I re-run the program and got the following outputs

kaloyan-raev commented 6 years ago

(removed)

kaloyan-raev commented 6 years ago

Opps, wrong issue. The above comment was targeted for #113.

kaloyan-raev commented 6 years ago

I was able to reproduce this with the following steps:

  1. Run Goobox
  2. Copy a file to the Goobox main folder
  3. Wait for the file to sync
  4. Stop Goobox
  5. Create subfolder and copy the file there
  6. Start Goobox again
  7. The file in subfolder displays syncing state without being actually synced at all