You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously we were calling the event defined as OnChange seprately from the attributes and associations. In the code we were calling it manually to emulate the framework behaviour because of some istorical reasons. At this moment analysis says that we can actually attach the onChange to attributes and association and make the framework handle this action automatically.
This is needed to mitigate the issue with a race condition between editing and calling actions. At the moment if association being edited is also part of the onCHange action parameters, the action (nanoflow) gets stale parameters, so when changing from Options 1 to Option 2 and then immediately calling manual onChange, the nanoflow gets Option 1, while user just changed Option 1 to Option 2.
This refactoring passes the responsibility of handing the race condition to the framework's built in functionality.
What is still broken
As I implemented this change, this revealed a possible bug in the framework where instead of stale parameter, the prameter is not passed at all. 😅 Waiting for the team to confirm if it's a bug on their side. For now one e2e test is expected to be broken.
What should be covered while testing?
Check that all existing OnChange actions are still working as expected for different types of attributes and association. This PR introduces e2e tests that cover majority of scenarios, there might be some I missed. Test pages are committed in the test project and stil lcompatible with 10.22, so you can check with old version of the widget.
Skipped (out of scope): openspec/ spec files, pnpm-lock.yaml, dist/
Findings
⚠️ Low — waitFrames(page, 10) is a frame-count timing wait
File:e2e/OnChange.spec.js line 127 Note:waitFrames(page, 10) pauses for 10 render frames before reading the log text. It works in practice but is fragile under load — if the microflow takes longer than expected the assertion can see stale output. A web-first assertion on the text widget first would make this resilient:
asyncfunctiongetLogs(page){// wait for at least one log entry to appear before readingawaitexpect(page.locator(".mx-name-text2")).not.toBeEmpty();consttext=awaitpage.locator(".mx-name-text2").innerText();returnparseLogEntries(text);}
Not blocking — waitFrames is used elsewhere in the repo and works — but worth improving before adding more tests that rely on this helper.
⚠️ Low — logEntryParser.js comment says "comma-separated" but the separator is !
File:e2e/utils/logEntryParser.js line 279 Note: The JSDoc above LIST_FIELDS reads "Field names whose raw value is a comma-separated list" but coerceListValue splits on "!". The block comment earlier in the file correctly describes the !-prefix format. A one-word fix prevents confusion for anyone reading just the inline JSDoc.
/** Field names whose raw value is a "!"-separated list (multi-relation). */constLIST_FIELDS=newSet(["multiAssocTitles"]);
Positives
test.describe.fixme used correctly to quarantine the known-broken "pass association to onChange" test — the bug is in the framework, not the widget, and the comment explains why.
docs/requirements/backend-structure.md updated in the same PR to document the platform behaviour, so future reviewers won't mistake the absent onChangeEvent prop for a typings sync issue.
The _valuesIsEqual guard removal is explicitly justified in the design doc — the platform already deduplicates by value, so the guard was dead code.
Boilerplate executeAction calls cleanly removed from every selector in one shot; the openspec change documents each touched file, making the scope easy to audit.
CHANGELOG entry is user-facing and accurate ("reliability of On change action") without exposing internal refactoring details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Refactoring (e.g. file rename, variable rename, etc.)
Description
Previously we were calling the event defined as OnChange seprately from the attributes and associations. In the code we were calling it manually to emulate the framework behaviour because of some istorical reasons. At this moment analysis says that we can actually attach the onChange to attributes and association and make the framework handle this action automatically.
This is needed to mitigate the issue with a race condition between editing and calling actions. At the moment if association being edited is also part of the onCHange action parameters, the action (nanoflow) gets stale parameters, so when changing from Options 1 to Option 2 and then immediately calling manual onChange, the nanoflow gets Option 1, while user just changed Option 1 to Option 2.
This refactoring passes the responsibility of handing the race condition to the framework's built in functionality.
What is still broken
As I implemented this change, this revealed a possible bug in the framework where instead of stale parameter, the prameter is not passed at all. 😅 Waiting for the team to confirm if it's a bug on their side. For now one e2e test is expected to be broken.
What should be covered while testing?
Check that all existing OnChange actions are still working as expected for different types of attributes and association. This PR introduces e2e tests that cover majority of scenarios, there might be some I missed. Test pages are committed in the test project and stil lcompatible with 10.22, so you can check with old version of the widget.