Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 6ee0d83

Browse files
Fixed bug with multiClient option, and fixed the test that was written incorrectly that would have caught the bug to begin with.
1 parent cb93af7 commit 6ee0d83

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/cache/reliability_manager.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class ReliabilityManager {
4949
const entry = this.getEntry(params.guidStr, params.hashStr, true);
5050
if(!entry.versionHash) {
5151
entry.versionHash = params.versionHashStr;
52-
entry.clientId = params.clientId;
5352
}
5453

5554
if(entry.state !== ReliabilityManager.reliabilityStates.Pending) {

test/reliability_manager.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ describe("ReliabilityManager", () => {
153153
const myRm = new ReliabilityManager(db, tmp.tmpNameSync(), { reliabilityThreshold: 2, multiClient: true });
154154
const guid = randomBuffer(consts.GUID_SIZE);
155155
const hash = randomBuffer(consts.HASH_SIZE);
156-
await myRm.processTransaction(new StablePutTransaction(guid, hash));
157156

158157
const trx = new StablePutTransaction(guid, hash);
159158
trx.clientAddress = "A";
@@ -162,6 +161,10 @@ describe("ReliabilityManager", () => {
162161
const entry = rm.getEntry(helpers.GUIDBufferToString(trx.guid), trx.hash.toString('hex'));
163162
assert.equal(entry.state, ReliabilityManager.reliabilityStates.Pending);
164163

164+
trx.clientAddress = "A";
165+
await myRm.processTransaction(trx);
166+
assert.equal(entry.state, ReliabilityManager.reliabilityStates.Pending);
167+
165168
trx.clientAddress = "B";
166169
await myRm.processTransaction(trx);
167170
assert.equal(entry.state, ReliabilityManager.reliabilityStates.ReliableNew);

0 commit comments

Comments
 (0)