Skip to content

Commit 7d816aa

Browse files
authored
CBL-6681: Send Database UID to Sync Gateway on blipsync (#2387)
We send the UUID in message getCollections as a property.
1 parent 1220b84 commit 7d816aa

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Replicator/Replicator.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "StringUtil.hh"
3232
#include "Logging.hh"
3333
#include "Headers.hh"
34+
#include "UUID.hh"
3435
#include "Instrumentation.hh"
3536
#include "fleece/Mutable.hh"
3637

@@ -117,11 +118,6 @@ namespace litecore::repl {
117118
_loggingID = string(db->useLocked()->getPath()) + " " + _loggingID;
118119
_importance = 2;
119120

120-
string dbLogName = db->useLocked([](const C4Database* db) {
121-
DatabaseImpl* impl = asInternal(db);
122-
return impl->dataFile()->loggingName();
123-
});
124-
125121
#ifdef LITECORE_CPPTEST
126122
_delayChangesResponse = _options->delayChangesResponse();
127123
_disableReplacementRevs = _options->disableReplacementRevs();
@@ -810,7 +806,10 @@ namespace litecore::repl {
810806
logVerbose("Requesting get collections");
811807

812808
MessageBuilder msg("getCollections"_sl);
813-
auto& enc = msg.jsonBody();
809+
UUID uuid = _db->useLocked([](C4Database* db) { return db->getPublicUUID(); });
810+
msg["uuid"_sl] = uuid.to_string();
811+
812+
auto& enc = msg.jsonBody();
814813
enc.beginDict();
815814
enc.writeKey("checkpoint_ids"_sl);
816815
enc.beginArray();

0 commit comments

Comments
 (0)