fix: change filter request default behaviour to ping (#1721)

This commit is contained in:
Hanno Cornelius 2023-05-09 09:18:14 +02:00 committed by GitHub
parent 81dffee893
commit 7c39be9a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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)