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:
parent
100e7e04c3
commit
8310cb3c05
1 changed files with 12 additions and 7 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue