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 attribute value change propagation and callback handling #2586

Merged
merged 11 commits into from
Oct 30, 2024

Conversation

yann-lty
Copy link
Member

Description

This PR aims to improve attribute value change propagation, introduced with the concept of "onAttributeChanged" callback system on node descriptors.
The goal is to fix data model access issues happening randomly in Meshroom, leading to broken UI components as shown below in the ImageGallery:
imageGallery

Features list

  • Test suites for validating both the current expected behavior and the refactoring.
  • Move attribute value change propagation and callback handling as part of the Node logic.

Implementation remarks

Part of the current implementation lives in the Attribute class, binding the valueChanged signal to a slot directly within the class constructor. This seems to be the root issue that breaks Qt's evaluation system.

This PR move that connection logic to the attributeFactory function, and bind it to a slot defined on the Node class, where all the attribute callback and value change propagation is now dealt with.

Unit tests were added to validate the expected behavior of this system.
And while not being able to write a specific test to validate this PR fixes the main visible problem stated in the description, many manual tests that were failing fast on the current implementation are now working fine.

Introduce test fixture to simplify graph testing in isolation.
Suite of tests to validate the behavior of desc.Node 'on{Attribute}Changed' behavior.
Test value change propagation and callback trigger
for attribute connected to Group and ListAttribues.
Move the attributeChanged callback logic within Node, as this
is a Node level mecanism (callbacks being declared on the node desc).

This commit also moves the attribute valueChanged signal outside of
the Attribute's constructor.
This seems to be the root cause to undesired side-effects breaking Qt's evaluation
system, data model access and consequently Meshroom's UI.
New test suite that focuses on testing the behavior of the attribute
changes callback system when such an attribute is connected to
an upstream dynamic output value.
@yann-lty yann-lty changed the title WIP: Fix attribute value change propagation and callback handling Fix attribute value change propagation and callback handling Oct 28, 2024
With valueChanged signal being connected outside of the
Attribute's constructor, the emitSignals logic is not required to prevent
early valueChanged propagation.
@cbentejac cbentejac self-requested a review October 28, 2024 14:18
@cbentejac cbentejac added this to the Meshroom 2024.1.0 milestone Oct 28, 2024
@cbentejac cbentejac merged commit 35914bd into develop Oct 30, 2024
3 checks passed
@cbentejac cbentejac deleted the fix/attributeValueChanged branch October 30, 2024 16:09
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