mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 00:46:44 +00:00
chore: lightpush - error metric less variable by only setting a fixed string (#3020)
This commit is contained in:
parent
5a0edff79a
commit
d3e6717a60
@ -88,11 +88,9 @@ suite "Waku Lightpush - End To End":
|
|||||||
|
|
||||||
# Then the message is not relayed but not due to RLN
|
# Then the message is not relayed but not due to RLN
|
||||||
assert publishResponse.isErr(), "We expect an error response"
|
assert publishResponse.isErr(), "We expect an error response"
|
||||||
assert (
|
|
||||||
publishResponse.error.contains(
|
assert (publishResponse.error == protocol_metrics.notPublishedAnyPeer),
|
||||||
"Lightpush request has not been published to any peers"
|
"incorrect error response"
|
||||||
)
|
|
||||||
), "incorrect error response"
|
|
||||||
|
|
||||||
suite "Waku LightPush Validation Tests":
|
suite "Waku LightPush Validation Tests":
|
||||||
asyncTest "Validate message size exceeds limit":
|
asyncTest "Validate message size exceeds limit":
|
||||||
@ -181,8 +179,5 @@ suite "RLN Proofs as a Lightpush Service":
|
|||||||
|
|
||||||
# Then the message is not relayed but not due to RLN
|
# Then the message is not relayed but not due to RLN
|
||||||
assert publishResponse.isErr(), "We expect an error response"
|
assert publishResponse.isErr(), "We expect an error response"
|
||||||
assert (
|
assert (publishResponse.error == protocol_metrics.notPublishedAnyPeer),
|
||||||
publishResponse.error.contains(
|
"incorrect error response"
|
||||||
"Lightpush request has not been published to any peers"
|
|
||||||
)
|
|
||||||
), "incorrect error response"
|
|
||||||
|
@ -5,6 +5,7 @@ import
|
|||||||
../waku_relay,
|
../waku_relay,
|
||||||
./common,
|
./common,
|
||||||
./protocol,
|
./protocol,
|
||||||
|
./protocol_metrics,
|
||||||
../waku_rln_relay,
|
../waku_rln_relay,
|
||||||
../waku_rln_relay/protocol_types
|
../waku_rln_relay/protocol_types
|
||||||
|
|
||||||
@ -54,8 +55,6 @@ proc getRelayPushHandler*(
|
|||||||
## Agreed change expected to the lightpush protocol to better handle such case. https://github.com/waku-org/pm/issues/93
|
## Agreed change expected to the lightpush protocol to better handle such case. https://github.com/waku-org/pm/issues/93
|
||||||
let msgHash = computeMessageHash(pubsubTopic, message).to0xHex()
|
let msgHash = computeMessageHash(pubsubTopic, message).to0xHex()
|
||||||
notice "Lightpush request has not been published to any peers", msg_hash = msgHash
|
notice "Lightpush request has not been published to any peers", msg_hash = msgHash
|
||||||
return err(
|
return err(protocol_metrics.notPublishedAnyPeer)
|
||||||
"Lightpush request has not been published to any peers. msg_hash: " & msgHash
|
|
||||||
)
|
|
||||||
|
|
||||||
return ok()
|
return ok()
|
||||||
|
@ -16,3 +16,4 @@ const
|
|||||||
emptyResponseBodyFailure* = "empty_response_body_failure"
|
emptyResponseBodyFailure* = "empty_response_body_failure"
|
||||||
messagePushFailure* = "message_push_failure"
|
messagePushFailure* = "message_push_failure"
|
||||||
requestLimitReachedFailure* = "request_limit_reached_failure"
|
requestLimitReachedFailure* = "request_limit_reached_failure"
|
||||||
|
notPublishedAnyPeer* = "not_published_to_any_peer"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user