StatusTracker: Emit OK for the last child before parents (#5467)
authorJocelyn Turcotte <jturcotte@woboq.com>
Wed, 18 Jan 2017 14:40:52 +0000 (15:40 +0100)
committerGitHub <noreply@github.com>
Wed, 18 Jan 2017 14:40:52 +0000 (15:40 +0100)
commitb68a28de8d6a49af00266e6930a03441ad73c53f
treebcd419d3342687abef4b6df3c049d44669246cbe
parent72a7b7ca42895e0ff09724e0ca92b6497918234c
StatusTracker: Emit OK for the last child before parents (#5467)

The current logic tried to avoid a DB lookup just to fetch whether
the file is shared or not since that info is already in the
SyncFileItem. The implementation would however need to decrease the
sync count for itself (and parents) before emitting the new status,
thus emitting the OK status for parents before that last child that
ended the propagation for that folder.

Change the implementation to achieve what we want: give the
possibility to decSyncCount to use a pre-fetched sharing state while
still doing the emission for all involved files. This ensures that
the leaf file also gets its status emitted before its parents.

Issue #4797
src/libsync/syncfilestatustracker.cpp
src/libsync/syncfilestatustracker.h
test/testsyncfilestatustracker.cpp