-
Notifications
You must be signed in to change notification settings - Fork 54
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: relay publish fails with 400 Bad Request when message contains meta field #2214
Comments
This also happens if instead of meta, the payload contains any extra field. Ex Also in the meantime I tested and got the same results with |
Discussed the issue with @NagyZoltanPeter The question is whether it's better to:
I'm not sure why support for those fields were not added to the API when designing the endpoints, and if supporting them is something even desired. Finally, not sure which changes imply defining a new version for the API and which ones can be done without having to define a new version. Let me know what you all think :)) |
Most likely this was an oversight, as the
Generally - if it breaks backwards compatibility (i.e. older clients can't use the API with the new changes), it should be a new API version. These decisions shouldn't be taken lightly, though, and we should avoid breaking changes on the API as much as possible. Adding new fields, for example, is not a breaking change as long as these fields default to something sensible if not populated. In this case, this is a bug/oversight that should be fixed and won't affect the API versioning. |
Weekly Update
|
PR was opened. We still need to avoid sending an error when an extra field is passed. We parse the field's name correctly and run the following line printing a warning that it's an unrecognized field nwaku/waku/waku_api/rest/relay/types.nim Line 95 in 9c0e943
However, right after that line is run (and when the next iteration of the for starts), an exception is thrown with the following stack trace:
and with the message:
Will discuss it with |
Sending this curl on wakuorg/nwaku:latest:
curl -vv -X POST "http://localhost:43393/relay/v1/messages/%2Fwaku%2F2%2Fdefault-waku%2Fproto" -H "accept: text/plain" -H "content-type: application/json" -d '{"payload": "SGVsbG8gV29ybGQh", "contentTopic": "/test/1/waku-relay/proto", "timestamp": 1699891642113786880, "meta": "dGVzdA=="}'
yields 400 Bad Request
On the logs side I can see
Notes!!
The text was updated successfully, but these errors were encountered: