propagate changes back from encrypted backend (#2079)

This commit is contained in:
wasaga 2021-04-12 09:42:45 -04:00 committed by GitHub
parent 8924b1a5fc
commit 6aa716bc95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 7 deletions

View file

@ -102,7 +102,14 @@ func (e *encryptedBackend) Put(ctx context.Context, record *databroker.Record) e
newRecord := proto.Clone(record).(*databroker.Record)
newRecord.Data = encrypted
return e.underlying.Put(ctx, newRecord)
if err = e.underlying.Put(ctx, newRecord); err != nil {
return err
}
record.ModifiedAt = newRecord.ModifiedAt
record.Version = newRecord.Version
return nil
}
func (e *encryptedBackend) Sync(ctx context.Context, version uint64) (RecordStream, error) {