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

Fix sync protocol integration tests

This commit is contained in:
mcrakhman 2023-06-06 22:08:06 +02:00
parent 100e7e04c3
commit 8310cb3c05
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -240,9 +240,6 @@ func (h *testSyncHandler) HandleMessage(ctx context.Context, senderId string, re
}
func (h *testSyncHandler) manager() *requestPeerManager {
if h.SyncHandler != nil {
return h.manager()
}
return h.peerManager
}
@ -275,10 +272,18 @@ func (h *testSyncHandler) run(ctx context.Context, t *testing.T, wg *sync.WaitGr
h.tree().Unlock()
continue
}
err = h.HandleMessage(ctx, res.senderId, res.msg)
if err != nil {
fmt.Println("error handling message", err.Error())
continue
if res.description().name == "FullSyncRequest" {
resp, err := h.HandleRequest(ctx, res.senderId, res.msg)
if err != nil {
fmt.Println("error handling request", err.Error())
continue
}
h.peerManager.SendPeer(ctx, res.senderId, resp)
} else {
err = h.HandleMessage(ctx, res.senderId, res.msg)
if err != nil {
fmt.Println("error handling message", err.Error())
}
}
}
}()