-
Notifications
You must be signed in to change notification settings - Fork 44
fix(step-details): Step's details panel is referencing an old value #1580
fix(step-details): Step's details panel is referencing an old value #1580
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1580 +/- ##
=======================================
Coverage ? 57.01%
=======================================
Files ? 68
Lines ? 2054
Branches ? 470
=======================================
Hits ? 1171
Misses ? 839
Partials ? 44
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
LGTM, + tested with blocked E2E test
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.
From functional point of view, I tried with VS Code and it is working better. No more able to reproduce the data loss.
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.
LGTM!
@lordrip only thing is that you have some dependency conflicts in |
Currently, when opening the step’s details tab, it’s not referencing the most recent values but keeping the previous values from a previous step. This generates unintentional changes to a different step than the user is intending to. This situation was caused because of the addition of a `debounce` function with the intention to only save the [form’s values after the user’s input stopped](#1537). The problem was that the `debounce` function was causing to capture the form’s value from the previous render, hence saving the wrong values to the previous step. To avoid this situation in the future, the saveConfig function now receives the original step and the new values. - Changes * Refactor saveConfig callback to receive the original step as parameter * Replace lodash' debounce function with useDebounceCallback() * Increase the debounce timer from 500ms to 1s * Update onChangeModel signature to (configuration: Record<string, unknown>, isValid: boolean) to reflect more accurately the intended parameters. * Remove the lodash.debounce dependency since is no longer required fix: #1561
119fbc8
Please retry analysis of this Pull-Request directly on SonarCloud. |
Description
Currently, when opening the step’s details tab, it’s not referencing the most recent values but keeping the previous values from a previous step.
This generates unintentional changes to a different step than the user is intending to.
This situation was caused because of the addition of a
debounce
function with the intention to only save the form’s values after the user’s input stopped.The problem was that the
debounce
function was causing to capture the form’s value from the previous render, hence saving the wrong values to the previous step.To avoid this situation in the future, the saveConfig function now receives the original step and the new values.
Changes
saveConfig
callback to receive the original step as a parameteruseDebounceCallback()
debounce
timer from500ms
to1s
onChangeModel
signature to(configuration: Record<string, unknown>, isValid: boolean)
to reflect more accurately the intended parameters.lodash.debounce
dependency since is no longer requiredBefore
Screencast.from.2023-03-29.07-46-54.webm
After
Screencast.from.2023-03-29.07-50-39.webm
fix: #1561