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