waku-org / nwaku

Waku node and protocol.
Other
199 stars 51 forks source link

bug: contentTopic naming not consistent in the store response where is's content_topic #2582

Closed fbarbu15 closed 3 months ago

fbarbu15 commented 5 months ago

Relay/filter/lightPush uses contentTopic While store returns content_topic

fbarbu15 commented 4 months ago

Bug was reintroduced by https://github.com/waku-org/nwaku/pull/2431

SionoiS commented 4 months ago

:| sorry

fbarbu15 commented 4 months ago

I think there is a confusion here. Relay returns contentTopic and store returned content_topic until it got fixed by https://github.com/waku-org/nwaku/pull/2584 to return also contentTopic Now we are back to how it was at the beginning with relay returning contentTopic and store returning content_topic Ex:

curl -v -X GET "http://127.0.0.1:51443/store/v1/messages?pubsubTopic=%2Fwaku%2F2%2Frs%2F0%2F0&pageSize=5&ascending=true" -H "Content-Type: application/json" -d 'None'
{"messages":[{"payload":"U3RvcmUgd29ya3MhIQ==","content_topic":"/myapp/1/latest/proto","version":0,"timestamp":1714466247670932480,"ephemeral":false}]}

curl -v -X GET "http://127.0.0.1:51443/relay/v1/messages/%2Fwaku%2F2%2Frs%2F0%2F0" -H "Content-Type: application/json" -d 'None'
[{"payload":"U3RvcmUgd29ya3MhIQ==","contentTopic":"/myapp/1/latest/proto","version":0,"timestamp":1714466247670932480,"ephemeral":false}]
Ivansete-status commented 4 months ago

I think there is a confusion here. Relay returns contentTopic and store returned content_topic until it got fixed by #2584 to return also contentTopic Now we are back to how it was at the beginning with relay returning contentTopic and store returning content_topic Ex:

curl -v -X GET "http://127.0.0.1:51443/store/v1/messages?pubsubTopic=%2Fwaku%2F2%2Frs%2F0%2F0&pageSize=5&ascending=true" -H "Content-Type: application/json" -d 'None'
{"messages":[{"payload":"U3RvcmUgd29ya3MhIQ==","content_topic":"/myapp/1/latest/proto","version":0,"timestamp":1714466247670932480,"ephemeral":false}]}

curl -v -X GET "http://127.0.0.1:51443/relay/v1/messages/%2Fwaku%2F2%2Frs%2F0%2F0" -H "Content-Type: application/json" -d 'None'
[{"payload":"U3RvcmUgd29ya3MhIQ==","contentTopic":"/myapp/1/latest/proto","version":0,"timestamp":1714466247670932480,"ephemeral":false}]

Morning @fbarbu15 ! Sorry for the confusion! How do you need it to be returned in all cases? Snake case or CamelCase? Cheers

fbarbu15 commented 4 months ago

Hey, either way is fine with me. The important thing is to be consistent with other fields and across endpoints(ex relay and store responses)

Ivansete-status commented 3 months ago

Hey @fbarbu15 ! Thanks for submitting this issue. We've standardized all fields to CamelCase and is now available in nwaku-master