1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 14:07:02 +09:00

Add empty response for proto message

This commit is contained in:
mcrakhman 2024-07-31 23:48:23 +02:00
parent 9b7b92f5c2
commit 491fe04d5c
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
2 changed files with 6 additions and 0 deletions

View file

@ -27,6 +27,9 @@ func (r *Response) MsgSize() uint64 {
} }
func (r *Response) ProtoMessage() (proto.Message, error) { func (r *Response) ProtoMessage() (proto.Message, error) {
if r.objectId == "" {
return &spacesyncproto.ObjectSyncMessage{}, nil
}
resp := &consensusproto.LogFullSyncResponse{ resp := &consensusproto.LogFullSyncResponse{
Head: r.head, Head: r.head,
Records: r.records, Records: r.records,

View file

@ -29,6 +29,9 @@ func (r *Response) MsgSize() uint64 {
} }
func (r *Response) ProtoMessage() (proto.Message, error) { func (r *Response) ProtoMessage() (proto.Message, error) {
if r.objectId == "" {
return &spacesyncproto.ObjectSyncMessage{}, nil
}
resp := &treechangeproto.TreeFullSyncResponse{ resp := &treechangeproto.TreeFullSyncResponse{
Heads: r.heads, Heads: r.heads,
SnapshotPath: r.snapshotPath, SnapshotPath: r.snapshotPath,