Compare commits

...

1 Commits

Author SHA1 Message Date
Jeremy Desanlis 6cecdfea09 [wip] potential fix : set the prevPHDKey 2018-08-08 19:50:18 -07:00
1 changed files with 9 additions and 8 deletions

View File

@ -22,6 +22,7 @@ class DelimiterMaster extends Delimiter {
*/ */
constructor(parameters) { constructor(parameters) {
super(parameters); super(parameters);
// non-PHD master version or a version whose master is a PHD version
this.prvPHDKey = undefined; this.prvPHDKey = undefined;
} }
@ -49,21 +50,21 @@ class DelimiterMaster extends Delimiter {
// generally we do not accept a specific version, // generally we do not accept a specific version,
// we only do when the master version is a PHD version // we only do when the master version is a PHD version
key = key.slice(0, versionIdIndex); key = key.slice(0, versionIdIndex);
if (key !== this.prvPHDKey) { if (key === this.prvPHDKey) {
return FILTER_ACCEPT; // trick repd to not increase its streak console.log('XXXX SKIP1');
return FILTER_SKIP; // trick repd to not increase its streak
} }
} } else if (Version.isPHD(value)) {
if (Version.isPHD(value)) {
// master version is a PHD version: wait for the next version // master version is a PHD version: wait for the next version
this.prvPHDKey = key; this.prvPHDKey = key;
console.log('XXXX ACCEPT');
return FILTER_ACCEPT; // trick repd to not increase its streak return FILTER_ACCEPT; // trick repd to not increase its streak
} } else if (Version.isDeleteMarker(value)) {
if (Version.isDeleteMarker(value)) {
// version is a delete marker, ignore // version is a delete marker, ignore
console.log('XXXX SKIP2');
return FILTER_ACCEPT; // trick repd to not increase its streak return FILTER_ACCEPT; // trick repd to not increase its streak
} }
// non-PHD master version or a version whose master is a PHD version this.prvPHDKey = key;
this.prvPHDKey = undefined;
if (this.delimiter) { if (this.delimiter) {
// check if the key has the delimiter // check if the key has the delimiter
const baseIndex = this.prefix ? this.prefix.length : 0; const baseIndex = this.prefix ? this.prefix.length : 0;