-
Notifications
You must be signed in to change notification settings - Fork 16
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
Getting timeout when expanding #21
Comments
Never mind, here is what worked for me: const { EmberClient } = require('emberplus-connection')
const host = '10.0.0.10'
const port = 9000
const run = async () => {
const client = new EmberClient(host, port)
client.on('error', err => console.log(err))
await client.connect()
// Get Root info
const req = await client.getDirectory(client.tree)
const root = await req.response
// Get a Specific Node
const node = await client.getElementByPath('1.1.1.1.1')
console.log(node)
// Expand entire tree under root
await client.expand(root)
console.log(root)
}
run () |
Same problem here:
with this function:
|
Hi there, i reopen this issue because i did some further testing. I built the following tree on TinyEmber and with the provider from this library: For both providers i made For the emberplus-connection everything is OK and the response package looks like this: I printed the argument
{
value: {
'0': QualifiedElementImpl {
contents: [EmberNodeImpl],
children: {},
parent: undefined,
path: '1.2'
}
},
errors: []
}
[
{
path: '1.2',
node: NumberedTreeNodeImpl {
contents: [EmberNodeImpl],
children: {},
parent: [QualifiedElementImpl],
number: 2
}
},
{
path: '1.2',
node: NumberedTreeNodeImpl {
contents: [EmberNodeImpl],
children: {},
parent: [QualifiedElementImpl],
number: 2
}
}
] For the TinyEmberplus provider it looks like this:
{
value: {
'0': QualifiedElementImpl {
contents: [EmberNodeImpl],
children: undefined,
parent: undefined,
path: '1.2'
}
},
errors: []
}
[
{
path: '1.2',
node: {
contents: [EmberNodeImpl],
children: undefined,
parent: [NumberedTreeNodeImpl],
path: '1.2',
number: 2
}
}
] i am not sure but i think the reason for the timeout is that the TinyEmber provider does not send any contents or information about the any children. Any ideas? |
Hi, i looked into the Ember+ protocol specification (Version 2.50) and on page 31:
So i think this is what TinyEmber and the DHD-device is doing and since it is described in the specification, the library should be able to handle this behaviour. Is _applyRootToTree the place where this should be handled? It also means that the provider implementation in the lib does not comply with the specification. |
Interesting, I may have missed that when implementing the Provider yeah. Would have to be updated. What is odd about the issue with the Client implementation is that we do get the Change with the correct path. This means that the request for the getDirectory should be resolved just fine. The |
The request times out because of the master...boristian:sofie-emberplus-connection:FIX_getDirectory-timeout-errors Is this the way to go and worth making a PR? |
I think #39 is getting at a very similar issue and it would be better to not expect children for a getDirectory at all then. Instead we should handle that case in the _handleIncoming method |
Hi, thanks for your response. |
@boristian I added some changes in #40 and can confirm that the library handles nodes (and parameters) without children set correctly in that branch. In addition I fixed some issue in the expand that meant it could only be used without having sent a GetDirectory to the root of the tree before |
@mint-dewit thank you! The timeout issue for nodes without children on the DHD device is gone. |
Hi,
first of all, thank you for this rewrite 👍
When playing around with it i'm always getting
UnhandledPromiseRejectionWarning: Error: Request timed out
when trying to expand a tree.Here is my code (more or less copied from the README.md):
Getting a specific path is no problem, but the expand. I have tried with TinyEmberPlus from Lawo and a DHD device, always the same.
Am I doing something wrong?
Greetings and thank you in advance
The text was updated successfully, but these errors were encountered: