magistrala icon indicating copy to clipboard operation
magistrala copied to clipboard

MF-1623 - Bring back WebSocket Adapter

Open AryanGodara opened this issue 2 years ago • 3 comments

Signed-off-by: AryanGodara [email protected]

What does this do?

This pull request brings back the WebSocket adapter

Which issue(s) does this PR fix/relate to?

Resolves #1623

List any changes that modify/break current functionality

Nil

Have you included tests for your changes?

Yes

Did you document any new/modified functionality?

Yes

Notes

N/A

AryanGodara avatar Jul 04 '22 14:07 AryanGodara

Codecov Report

Merging #1625 (0254241) into master (2e02991) will decrease coverage by 0.04%. The diff coverage is 66.49%.

@@            Coverage Diff             @@
##           master    #1625      +/-   ##
==========================================
- Coverage   68.95%   68.91%   -0.05%     
==========================================
  Files         138      143       +5     
  Lines       11350    11544     +194     
==========================================
+ Hits         7826     7955     +129     
- Misses       2830     2888      +58     
- Partials      694      701       +7     
Impacted Files Coverage Δ
ws/api/logging.go 0.00% <0.00%> (ø)
ws/client.go 66.66% <66.66%> (ø)
ws/api/endpoints.go 76.34% <76.34%> (ø)
ws/adapter.go 91.11% <91.11%> (ø)
ws/api/transport.go 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Jul 06 '22 08:07 codecov-commenter

It seems to be working now, Manual Test:

$make run 
$ ./mainflux-cli provision test (To get readymade thing and channel, that are connected (saves time on doing manually)
$ go run cmd/main.go (server starts listening)
$ go run cmd/ws_client.go (ws connection successful)

$ ./coap-cli-linux get channels/CHANNELID/messages --auth THINGKEY -o (Start listening on coap, to check if there is error with only ws-adapter, or in general error with sending messages)

$ curl -s -S -i -X POST -H "Content-Type: application/senml+json" -H "Authorization: Thing THINGKEY" https://localhost/http/channels/CHANNELID/messages -d '[{"random":"message}]'

OUTPUT:- received the message on both cli and ws terminal windows (tried multiple times)

AryanGodara avatar Jul 13 '22 17:07 AryanGodara

@AryanGodara Please, update your branch and remove draft tag when the PR is ready

manuio avatar Jul 14 '22 10:07 manuio

@manuio this one seems to be ready. PLease review and approve if OK.

drasko avatar Sep 13 '22 23:09 drasko