Skip to content

Commit

Permalink
Skip even attempt to index if doc is encrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
islamaliev committed Aug 13, 2024
1 parent 658a092 commit 168f943
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/db/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,15 @@ func syncIndexedDoc(
return err
}

if isDeletedDoc {
return col.deleteIndexedDoc(ctx, oldDoc)
} else if isNewDoc {
// this can happen we received an encrypted document that we haven't decrypted yet
if isNewDoc && isDeletedDoc {
return nil
}

if isNewDoc {
return col.indexNewDoc(ctx, doc)
} else if isDeletedDoc {
return col.deleteIndexedDoc(ctx, oldDoc)
} else {
return col.updateDocIndex(ctx, oldDoc, doc)
}
Expand Down

0 comments on commit 168f943

Please sign in to comment.