Skip to content

Commit

Permalink
Adjust logging in ChangesStream
Browse files Browse the repository at this point in the history
  • Loading branch information
tkleinke committed Nov 4, 2019
1 parent a287916 commit 66261fa
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/core/datastore/core/changes-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class ChangesStream {
}

if (isProjectDocument(document) && document._conflicts !== undefined) {
console.log('project document conflict detected');
this.documentsScheduledToWelcome[document.resource.id] = setTimeout(
() => this.onTimeout(document), Math.random() * 10000);
} else {
Expand All @@ -84,10 +83,10 @@ export class ChangesStream {
delete this.documentsScheduledToWelcome[document.resource.id];
let solvedDocument: Document|undefined = undefined;
try {
solvedDocument = await this.resolveConflict(document)
console.log('Resolve project document conflict', JSON.stringify(document));
solvedDocument = await this.resolveConflict(document);
} catch (err) {
console.error("will not put document to index due to " +
"error in ChangesStream.resolveConflict", err);
console.error('Will not put document to index due to error in ChangesStream.resolveConflict', err);
return;
}
await this.welcomeDocument(solvedDocument);
Expand Down Expand Up @@ -169,9 +168,6 @@ export class ChangesStream {

private static shouldUpdate([documentAfterConflictResolution, squashRevisionIds]: [Document, Array<RevisionId>], latestRevisionDocument: Document) {

console.log('document after conflict resolution', documentAfterConflictResolution);
console.log('squashRevisionIds', squashRevisionIds);

return squashRevisionIds.length > 0
// compare for length instead of equality, because we want to avoid loops where one machine reduces a length and then updates while another does the opposite
|| documentAfterConflictResolution.resource[STAFF].length > latestRevisionDocument.resource[STAFF].length
Expand Down

0 comments on commit 66261fa

Please sign in to comment.