Skip to content

Commit

Permalink
fix: empty responses should not generate an error
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Jan 23, 2023
1 parent e0ccdbe commit 29a6c15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions waku/v2/protocol/store/waku_store_client.go
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions waku/v2/protocol/store/waku_store_common.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 29a6c15

Please sign in to comment.