diff --git a/app/ldiff/diffcontainer.go b/app/ldiff/diffcontainer.go index d6b43b34..c9ee867e 100644 --- a/app/ldiff/diffcontainer.go +++ b/app/ldiff/diffcontainer.go @@ -30,12 +30,14 @@ func (d *diffContainer) PrecalculatedDiff() Diff { func (d *diffContainer) Set(elements ...Element) { d.initial.mu.Lock() defer d.initial.mu.Unlock() + defer d.initial.markHashDirty() d.precalculated.Set(elements...) } func (d *diffContainer) RemoveId(id string) error { d.initial.mu.Lock() defer d.initial.mu.Unlock() + defer d.initial.markHashDirty() return d.precalculated.RemoveId(id) } diff --git a/app/ldiff/olddiff.go b/app/ldiff/olddiff.go index 71f2f0a8..9d44b900 100644 --- a/app/ldiff/olddiff.go +++ b/app/ldiff/olddiff.go @@ -251,6 +251,10 @@ func (d *olddiff) Diff(ctx context.Context, dl Remote) (newIds, changedIds, remo return dctx.newIds, dctx.changedIds, dctx.removedIds, nil } +func (d *olddiff) markHashDirty() { + d.hashIsDirty.Store(true) +} + func (d *olddiff) compareResults(dctx *diffCtx, r Range, myRes, otherRes RangeResult) { // both hash equals - do nothing if bytes.Equal(myRes.Hash, otherRes.Hash) {