SocketAPI: Only push status for files requested by the shell #5361
authorJocelyn Turcotte <jturcotte@woboq.com>
Wed, 11 Jan 2017 17:27:22 +0000 (18:27 +0100)
committerJocelyn Turcotte <jturcotte@woboq.com>
Wed, 18 Jan 2017 11:15:52 +0000 (12:15 +0100)
commitd3a0608bd543f23c22595aa5844545c352a8dba1
treeae3dbe19fc2e1e60cfcc17397c5416c093c35399
parentc25b599bbba9226870a3ab17be5a01562f8088fb
SocketAPI: Only push status for files requested by the shell #5361

We currently push the SYNC status for all files that will be propagated,
and then the OK status when those files are propagated.
On top of this, we send those statuses to all clients connected, even
if the socket is kept open by an application that only needed to show
a file open dialog. On macOS we're also using an NSConnection which
means that we have to wait for the RPC call to return from the
extension, which makes bulk status changes possibly heavy.

Reduce the time spent needlessly sending status pushes by limiting
them to files requested through that socket since it connected.
To limit the data to store, only remember the parent directory of
files requested, and store those in a bloom filter.

Note that this adds a requirement to shell extensions: they should
make sure that the status cache only contains entries that have been
requested through the socket API. In other words, the status cache
must be empty when each socket client connects to the socket API.
Otherwise the cached icon type will be shown to the user, and the
SocketAPI won't push new status for that file if it didn't receive
a RETRIEVE_FILE_STATUS.
src/gui/folderman.cpp
src/gui/socketapi.cpp
src/gui/socketapi.h
src/libsync/syncfilestatustracker.cpp