Skip to content

Conversation

etrousset
Copy link
Member

What does this PR do?

Fix exception when subscribed to a channel in which someone publish a message using REST API

See https://jira.kaliop.net/browse/KZL-791

How should this be manually tested?

Use the following client 👍

const Kuzzle  = require('kuzzle-sdk').Kuzzle;


const kuzzle = new Kuzzle('websocket', {host: 'localhost'});

async function run() {
 await kuzzle.connect();
 const roomID = await kuzzle.realtime.subscribe('obix', 'firmwares', {}, (r) => {
   console.log(r);
 })
 
 await kuzzle.realtime.publish('obix', 'firmware', {msg: 'hello world'})
}

run()

Use rest API to publish a message:

POST http://localhost:7512/obix/firmwares/_publish HTTP/1.1
Content-Type: application/json

{
  "msg" : "Heelo REST API"
}

=> No more exception

-fixed self message exception when the publisher of the message didn't provide any volatile data
@codecov-io
Copy link

codecov-io commented Oct 31, 2018

Codecov Report

Merging #333 into 6-dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##            6-dev     #333   +/-   ##
=======================================
  Coverage   97.49%   97.49%           
=======================================
  Files          28       28           
  Lines        1395     1395           
=======================================
  Hits         1360     1360           
  Misses         35       35
Impacted Files Coverage Δ
src/controllers/realtime/room.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8cd9f2c...d5b09e3. Read the comment docs.

@etrousset etrousset changed the base branch from 6-beta to 6-dev October 31, 2018 12:34
@alexandrebouthinon alexandrebouthinon merged commit 35fd37c into 6-dev Oct 31, 2018
@alexandrebouthinon alexandrebouthinon deleted the KZL-791-fix-exception-when-publish-msg-with-REST-API branch October 31, 2018 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants