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
Cannot read property '_$onMessage' of undefined #167
Comments
Seems to happen during reconnection:
|
Here is a reproducible example: import deepstream from 'deepstream.io-client-js'
const ds = deepstream('0.0.0.0:6021')
.login({}, (success, authData) => {
if (!success) {
console.log({ authData }, 'Deepstream Authentication Failed. Shutting down...')
setTimeout(() => process.exit(1), 500)
}
})
ds.on('connectionStateChanged', connectionState => {
console.log({ connectionState }, 'Deepstream Connection State Changed.')
})
ds.on('error', (error, event, topic) => {
console.log({ error, event, topic }, 'Deepstream Error.')
})
setInterval(() => {
for (let n = 0; n < 8; ++n) {
updateRecord()
}
}, 500)
let x = 0
function updateRecord () {
const record = ds.record.getRecord('test/1')
record.set({ x })
record.discard()
x++
}
|
Great, thank you! |
Any progress on this issue? It's starting to become a bit more urgent for us... |
We got this issue and the other two you just commented on put in for the next release, aiming for friday/monday. |
The issue it's fixed in a branch, missing some tests. 'use strict'
const deepstream = require('.')
const Promise = require('bluebird')
const ds = deepstream('0.0.0.0:6021')
.login({}, (success, authData) => {
if (!success) {
console.log({ authData }, 'Deepstream Authentication Failed. Shutting down...')
setTimeout(() => process.exit(1), 500)
}
})
ds.on('connectionStateChanged', connectionState => {
console.log({ connectionState }, 'Deepstream Connection State Changed.')
})
ds.on('error', (error, event, topic) => {
console.log({ error, event, topic }, 'Deepstream Error.')
})
setInterval(Promise.coroutine(function*() {
for (let n = 0; n < 8; ++n) {
yield updateRecord()
}
}), 500)
let x = 0
function updateRecord () {
console.log(x)
return new Promise((resolve, reject) => {
const record = ds.record.getRecord('test/1')
record.set({ x: x++ })
record.on( 'discard', () => {
resolve()
})
record.discard()
})
} If you want to do the same with |
Bug/#167 multiple discards of the same record
The text was updated successfully, but these errors were encountered: