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

Add HeadsApply

This commit is contained in:
mcrakhman 2024-08-12 17:25:39 +02:00
parent 0519718e51
commit 6dae561775
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -62,8 +62,10 @@ func (s *syncHandler) HandleHeadUpdate(ctx context.Context, statusUpdater syncst
defer s.tree.Unlock()
if len(contentUpdate.Changes) == 0 {
if s.hasHeads(s.tree, contentUpdate.Heads) {
statusUpdater.HeadsApply(peerId, update.ObjectId(), contentUpdate.Heads, true)
return nil, nil
}
statusUpdater.HeadsApply(peerId, update.ObjectId(), contentUpdate.Heads, false)
return s.syncClient.CreateFullSyncRequest(peerId, s.tree), nil
}
rawChangesPayload := objecttree.RawChangesPayload{