1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Derived fixes

This commit is contained in:
mcrakhman 2024-12-31 00:10:41 +01:00
parent 1e87107991
commit fdae244b64
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
2 changed files with 5 additions and 1 deletions

View file

@ -145,6 +145,9 @@ func (h *headSync) Close(ctx context.Context) (err error) {
func (h *headSync) fillDiff(ctx context.Context) error {
var els = make([]ldiff.Element, 0, 100)
err := h.storage.HeadStorage().IterateEntries(ctx, headstorage.IterOpts{}, func(entry headstorage.HeadsEntry) (bool, error) {
if entry.IsDerived && entry.Heads[0] == entry.Id {
return true, nil
}
els = append(els, ldiff.Element{
Id: entry.Id,
Head: concatStrings(entry.Heads),

View file

@ -15,7 +15,8 @@ type headUpdater struct {
func newHeadUpdater(update func(update headstorage.HeadsUpdate)) *headUpdater {
return &headUpdater{
batcher: mb.New[headstorage.HeadsUpdate](0),
batcher: mb.New[headstorage.HeadsUpdate](0),
updateFunc: update,
}
}