Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: lack of error checking in publish #2190

Closed
1 task
alrevuelta opened this issue Nov 7, 2023 · 3 comments · Fixed by #2339
Closed
1 task

bug: lack of error checking in publish #2190

alrevuelta opened this issue Nov 7, 2023 · 3 comments · Fixed by #2339
Assignees
Labels
bug Something isn't working

Comments

@alrevuelta
Copy link
Contributor

If I post a message using autosharding but with a wrong contentTopic like the one below.

 curl -X POST "http://127.0.0.1:8645/relay/v1/auto/messages" \
 -H "content-type: application/json" \
 -d '{"payload":"ZXhhbXBsZQ==","contentTopic":"bbbbb"}'

It errors silently:

2023-11-07 13:53:57 ERR 2023-11-07 12:53:57.141+00:00 Autosharding error                         topics="waku node" tid=1 file=waku_node.nim:322 error="invalid format: topic must start with slash"

But the API call still returns OK, which is obviously wrong, since the message wasn't published.

Mainly due to this:

let pubsubTopic = pubsubTopicOp.valueOr:
getShard(message.contentTopic).valueOr:
error "Autosharding error", error=error
return

Solution:

  • Return an error in the REST API if the message was not published due to an autosharding error.
@alrevuelta alrevuelta added the bug Something isn't working label Nov 7, 2023
@chair28980 chair28980 assigned gabrielmer and SionoiS and unassigned gabrielmer Dec 5, 2023
@SionoiS SionoiS removed their assignment Dec 5, 2023
@gabrielmer gabrielmer self-assigned this Dec 21, 2023
@gabrielmer
Copy link
Contributor

Weekly Update

  • achieved: reproduced, investigated and started improving error handling
  • next: continue with the implementation

@gabrielmer
Copy link
Contributor

Weekly Update

  • achieved: fixed compilation errors, got it to work and tested it
  • next: add test cases to the codebase and open PR

@gabrielmer
Copy link
Contributor

Weekly Update

  • achieved: added test, fixed bug, started fixing non-compiling tests in dependent areas of the code
  • next: finish adapting dependent tests to the new behavior and proc signatures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants