Skip to content

Commit

Permalink
fix: change filter request default behaviour to ping (#1721)
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-clius authored May 9, 2023
1 parent 81dffee commit 7c39be9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion waku/v2/waku_filter_v2/protocol.nim
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ proc initProtocolHandler(wf: WakuFilter) =

let decodeRes = FilterSubscribeRequest.decode(buf)
if decodeRes.isErr():
error "Failed to decode filter subscribe request", peerId=conn.peerId
error "Failed to decode filter subscribe request", peerId=conn.peerId, err=decodeRes.error
waku_filter_errors.inc(labelValues = [decodeRpcFailure])
return

Expand Down
3 changes: 2 additions & 1 deletion waku/v2/waku_filter_v2/rpc_codec.nim
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ proc decode*(T: type FilterSubscribeRequest, buffer: seq[byte]): ProtobufResult[

var filterSubscribeType: uint32
if not ?pb.getField(2, filterSubscribeType):
return err(ProtobufError.missingRequiredField("filter_subscribe_type"))
# Revert to ping by default if not set
rpc.filterSubscribeType = FilterSubscribeType.SUBSCRIBER_PING
else:
rpc.filterSubscribeType = FilterSubscribeType(filterSubscribeType)

Expand Down

0 comments on commit 7c39be9

Please sign in to comment.