Skip to content
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

fix getDirectory for parameters #39

Closed
wants to merge 2 commits into from

Conversation

lukirs95
Copy link

About the Contributor

This pull request is posted on behalf of NEP Germany.

Type of Contribution

This is a: Bug fix

Current Behavior

In current releases of Lawo MC square devices you need to explicitly send a "Get Directory" request down to the parameter in order to get updates from the device. This is not the case. The "getElementByPath()" request currently only requests until the parent of the specified node.

New Behavior

"getElementByPath()" now explicitly requests the whole specified path. This fixes the problem, that sometimes no update is received from specific parameters

Status

[ x ] PR is ready to be reviewed.
[ x ] The functionality has been tested by the author.
[ x ] Relevant unit tests has been added / updated.
[ x ] Relevant documentation (code comments, system documentation) has been added / updated.

Copy link

@mint-dewit mint-dewit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello!

Thank you for contributing to the Sofie Project! I have taken an initial look at this PR and have some questions left. Hopefully you'll be able to help me with them so we can get this merged.

}

// this resulted in doubled subscription because getDirectory() adds the element as well

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what's going on here. Since the callback is never passed to the getDirectory call it should not cause a double subscription.

cb,
})
if (tree) {
const req = await this.getDirectory(tree)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constant is never used so it is not necessary to assign it

Comment on lines +397 to +399
const req = await this.getDirectory(tree)
tree = (await req.response) as NumberedTreeNode<EmberElement>
tree = getNextChild(tree, i)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me understand why this is needed in regards to the main issue this PR addresses?

The reason I am asking it makes it such that every time a library user uses this call the library will fetch all nodes in the path even though we have already fetched these before and can just look at them locally.

@mint-dewit
Copy link

Closing as this is superseded by #40

@mint-dewit mint-dewit closed this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants