I want to develop a small UX improvement regarding whether a shared folder is actually syncing with a remote device. Currently, only the remote device completion permanently being less than 100 % indicates when it might not have accepted the folder. I’d like feedback on several aspects before starting off with an implementation.
The information is already available while a connection is active, because we can track missing entries in the remote’s ClusterConfig messages.
UI Integration
a. My minimal approach to present the information would be appending an asterisk mark to entries the “Shared With” device list where we know they are not sharing back. Same under the “Folders” list for each remote device. Might need hovering for the tooltip to see all of them.
b. Add a new field below said entries titled “Waiting to Accept” (or similar) and listing the respective devices / folders again. The line is hidden like others without content.
c. Open for other suggestions. They should be rather low-profile IMHO as to not really disturb the user, as this is usually a temporary condition where no action can be taken locally.
d. Longer-term such info about the cluster connectivity / density / health could be summarized into a new dialog, as sketched previously. Mainly as a “task list”, but maybe even with an interactive graph showing the relationships.
API Extension
a. As this is kind of the inverse of the /rest/cluster/pending/*
information, I propose a new /rest/cluster/unaccepted
endpoint to list the device / folder ID combinations we know won’t actually exchange data, possibly augmented by the last ClusterConfig timestamp that assumption is based on.
b. Alternatively, the /rest/system/connections
endpoint could be extended with a list of unaccepted folder IDs. Kind of makes sense because the info is always based on an active connection. But I’d prefer to keep it semantically separate from the connections hodgepodge.
A related question is whether we want to update the list on the UI (client) side using a new event type, extend the existing PendingFoldersChanged
event or just fetch the endpoint data again when a connection is made / closed / replaced (don’t think there is a separate event type?).
Internal Model Representation
a. We already have a remotePausedFolders map[protocol.DeviceID]map[string]struct{} // deviceID -> folders
with a similar purpose, which could be mirrored to remoteMissingFolders map[protocol.DeviceID][]string
. It gets updated from the ClusterConfig()
receiving function or from Closed()
.
b. There is also a cache for helloMessages map[protocol.DeviceID]protocol.Hello
, why shouldn’t we add the same for clusterConfigs map[protocol.DeviceID]protocol.ClusterConfig
? This could be used to feed other API endpoints depending on the information without much processing (remotePausedFolders
, pending folders or the suggested “candidates” feature, possibly others) without introducing purpose-built data structures for each one.
Note that this information depends on the remote being well-behaved regarding their BEP ClusterConfig messages. But if they don’t announce the folder back, I think synchronization already won’t work.
Please let me know what you think about the above design choices. I want to avoid long discussions after much work has gone into a PR, as we had in the past.