Description
This ticket is to formally add the new test file test/siesta/tests/state/FeedbackLoop.mjs to the repository and the test suite.
This test was created to verify and prevent a potential infinite recursion (feedback loop) when using Neo.state.Provider with form fields.
Key Scenarios Tested
The FeedbackLoop.mjs test file ensures the following:
- No Change Event on Programmatic Update: When a component's
value is updated programmatically via a state provider binding, it correctly updates the component's config but does not fire a change event. This is critical to prevent controllers from reacting to their own state changes.
- Change Event on User-like Interaction: When a component's
value is changed directly (simulating a user interaction), it does fire the change event as expected.
- Feedback Loop Prevention: It simulates a common controller pattern where a
change event handler calls provider.setData(). The test verifies that this sequence does not trigger another change event, thus preventing an infinite loop.
Action Items
- Add the new file
test/siesta/tests/state/FeedbackLoop.mjs to the project.
- Register the new test file in
test/siesta/siesta.js to ensure it is run as part of the standard test suite. It should be added to the state group.
Description
This ticket is to formally add the new test file
test/siesta/tests/state/FeedbackLoop.mjsto the repository and the test suite.This test was created to verify and prevent a potential infinite recursion (feedback loop) when using
Neo.state.Providerwith form fields.Key Scenarios Tested
The
FeedbackLoop.mjstest file ensures the following:valueis updated programmatically via a state provider binding, it correctly updates the component's config but does not fire achangeevent. This is critical to prevent controllers from reacting to their own state changes.valueis changed directly (simulating a user interaction), it does fire thechangeevent as expected.changeevent handler callsprovider.setData(). The test verifies that this sequence does not trigger anotherchangeevent, thus preventing an infinite loop.Action Items
test/siesta/tests/state/FeedbackLoop.mjsto the project.test/siesta/siesta.jsto ensure it is run as part of the standard test suite. It should be added to thestategroup.