-
Notifications
You must be signed in to change notification settings - Fork 26
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
hotfix: data-items local variables #2780
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional test passed on highlighted debug
deployment sheet, as well as on plh_kids_kw
deployment where the issue was first discovered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, the changes and explanation make sense
PR Checklist
Description
Fix regression introduced by #2767 where data_items no longer passed outer local variables to inner items
Review Notes
Minimal reproduction of issue available at comp_data_items_debug_2
Should be broken on master but fixed in branch. Should also confirm original issue resolved
Dev Notes
I should have been a bit more careful when adding the additional variable that is meant to stay in sync with the templateRowMap, not realising that the rowMap was updated in multiple places not just the main processor. As part of this fix I checked the codebase for anywhere the
templateRowMap
was updated and tried to ensure the relatedtemplateRowMapValues
was also.A better solution might have been to only allow the
templateRowMap
to be set/updated from a method (not directly), and just using that method to ensure both values updated, however that would have been a larger refactor so not included at this moment. Alternatively the values could be created through some sort of getter/function, however it would require a level of memoizing or using computed signal in service to prevent repeated recalculation as it is accessed by every row processor.I tried adding tests to capture the behaviour, however the code change is within the
hackProcessRows
method which is stubbed for testing so not easy to do. However the behaviour is captured within comp_data_items Example 3 (accessing completed_counter inside of items), so now that visual tests are back working the component sheet should pick up any future regression if visually tested.I have also added some minor test updates to the
template-action.service.spec
that check the general case of the templateRowMapValues being updated (wouldn't have caught this specific issue but good to have for future ref)Git Issues
Closes #2777
Screenshots/Videos
If useful, provide screenshot or capture to highlight main changes