waku-org / waku-frontend

Waku's frontend. Interact with your waku node via this simple user interface
1 stars 2 forks source link

bug: unable to decode message sent via REST API on wakuNode #36

Open chaitanyaprem opened 1 month ago

chaitanyaprem commented 1 month ago

While using this frontend app as part of https://github.com/waku-org/nwaku-compose I had noticed the following decode error when i sent a message using commandline. This is what i had used to send a message as explained in nwaku-compose repo.

curl -X POST "http://127.0.0.1:8645/relay/v1/auto/messages" -H "content-type: application/json" -d '{"payload":"'$(echo -n "Hello Waku Network - from Anonymous User" | base64)'","contentTopic":"/universal/1/community/waku"}'

`decode message error 
Object { payload: "SGVsbG8gV2FrdSBOZXR3b3JrIC0gZnJvbSBBbm9ueW1vdXMgVXNlcg==", contentTopic: "/universal/1/community/waku", version: 0, timestamp: 1720405343121209300, ephemeral: false }
 SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    decodeMsg App.tsx:390
    children App.tsx:588
    App App.tsx:588
    React 8
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533`
kaichaosun commented 1 month ago

@chaitanyaprem the encoding method is different in frontend if I remember correctly. The future of waku-frontend may include such inter operability, but I think we need to discuss it more before implement new features.