fix: empty responses should not generate an error

This commit is contained in:
Richard Ramos 2023-01-19 16:03:04 -04:00 committed by RichΛrd
parent e0ccdbe966
commit 29a6c1579d
2 changed files with 4 additions and 5 deletions

View File

@ -206,9 +206,10 @@ func (store *WakuStore) queryFrom(ctx context.Context, q *pb.HistoryQuery, selec
}
if historyResponseRPC.Response == nil {
logger.Error("empty response")
metrics.RecordStoreError(store.ctx, "emptyRpcResponseFailure")
return nil, ErrEmptyResponse
// Empty response
return &pb.HistoryResponse{
PagingInfo: &pb.PagingInfo{},
}, nil
}
metrics.RecordMessage(ctx, "retrieved", len(historyResponseRPC.Response.Messages))

View File

@ -41,8 +41,6 @@ var (
ErrFailedQuery = errors.New("failed to resolve the query")
ErrFutureMessage = errors.New("message timestamp in the future")
ErrEmptyResponse = errors.New("empty store response")
)
type WakuSwap interface {