The gateway-key store rides the settings part, and a first sync brings
a part changed only on the server in whole. So a computer with its own
gateway keys that joined a folder another computer had set up first had
every key replaced by the folder's store (8ugMak1r on #1714 got them
back only from the -this-computer copy in the sync folder). On the first
sync, before the settings are brought in, the keys this computer holds
that the store has neither by id nor by value are added to the store
brought in; that merged store is restored here and pushed for the
others. A key the folder holds wins; the LAN default key follows the
folder's settings as before. After the join a key missing from a store
this computer has seen is a removal, as before.
ggbdpq's patch (a9605c8a), cherry-picked unchanged.
Run (reviewer): TestGatewayKeysJoinKeepsUnseenKeys fails on the old
davsync.go (the joining computer's keys are gone, the pushed store holds
only the folder's default key, computer B never gets A's key) and passes
with it, -race -count=3; TestGatewayKeysJoinWithoutStoreKeepsKeys passes
on both. go test ./internal/davsync/... ok. Not tried against a real
WebDAV server.