-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Reduce tool form building frequency #18969
base: dev
Are you sure you want to change the base?
Reduce tool form building frequency #18969
Conversation
e15b9f9
to
6fb172b
Compare
@@ -284,7 +285,7 @@ export default { | |||
this.onUpdate(); | |||
} | |||
}, | |||
onUpdate() { | |||
onUpdate: debounce(function (e) { |
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.
This doesn't look quite right as a fix. If we've got those datasets in the initial form build we really don't need to fire onUpdate in the first place.
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.
It is hard to track where the change is coming from. So many components firing change events are involved here, that is the best solution I could come up with without having intimate knowledge about the tool form and tool build process 😞
Maybe @guerler or someone else more familiar with the tool form can have a closer look?
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.
Thanks for looking into this. There was a LastQueue
mechanism specifically built to avoid multiple redundant requests to the API. I would consider a regression in that mechanism to be a bug, it could prevent users from effectively using certain tools due to a large number of possibly slow requests.
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.
This is a workaround though, not a fix. If we come in with a defined set of inputs, there's no reason to fire off any requests.
Nothing's really broken here, I would target dev since I could see this having subtle side-effects that we're notoriously bad at testing. |
Good point! Done! |
6fb172b
to
ec7db4a
Compare
c129e57
to
e9b7abf
Compare
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.
I don't think request volume / debounce tradeoff is worth it.
Isn't this is a good thing ? What made you decide to revert this ? |
Co-authored-by: Marius van den Beek <[email protected]>
e9b7abf
to
2b5d16a
Compare
That change was breaking this test:
Unfortunately, the test results are gone after the rebase. For some reason, the event must be fired on creation for this test to pass (maybe the problem is with the test?). In addition, after intensive debugging, the change didn't seem to make any significant difference in reducing the form rebuilding as far as I could tell, so I decided to revert it. I will restore it and we can investigate the test further.
Why not, we want the most up-to-date request anyway, no? 🤔 Sorry, I'm afraid I don't know how to improve the situation 😞 I know this is just a palliative measure and the real issue is the complex event interaction in these components. On the other hand, I could keep debugging and investigating with more time since this is no longer scheduled for this release. |
This reverts commit 2b5d16a. As `request volume` / `debounce` tradeoff is not worth it.
500ms delay is a lot of delay and a high price to pay.
This is weird, see #18848 (comment).
👍 maybe this is a good moment to see if we want to change how data is passed up and down the component hierarchy. |
Mitigates #18848
When we have multiple data inputs in a tool, the ToolForm will request a tool rebuild for each data input in rapid succession (see #18848 (comment)).
This will ensure that only the last request with all the updated data is sent.
Before
After
How to test the changes?
License