leantime
leantime copied to clipboard
[BUG] jQuery initiates LOTS of PATCH requests to index.php while resizing
When a user resizes a window, jQuery sends out a lot of PATCH HTTP requests. (between 8 and 12 per second per user) Because of this, I receive lots of "server reached pm.max_children"-warnings.
To Reproduce Steps to reproduce the behavior:
- Open Leantime
- Either look at the HTTP servers logs or at the development tools network tab in google chrome.
- Resize the window
- see a lot of requests
Expected behavior I don't know what they do, but we have to throttle this to once a second max.
Leantime Version 2.2.4 - Docker-compose version
Additional context When a hand full of people are using the system, this could be ignored, but in bigger settings, this would slow everything down.
Woah, that is weird. Is that on the kanban screen? Do you know what is being patched?
My first guess is that sortable() is being triggered on a resize() which in turn sends a patch to update ticket status. I’ll check it out.
On Sun, Aug 7, 2022 at 3:05 PM Peter Hulstaert @.***> wrote:
When a user resizes a window, jQuery sends out a lot of PATCH HTTP requests. (between 8 and 12 per second per user) Because of this, I receive lots of "server reached pm.max_children"-warnings.
To Reproduce Steps to reproduce the behavior:
- Open Leantime
- Either look at the HTTP servers logs or at the development tools network tab in google chrome.
- Resize the window
- see a lot of requests
[image: image] https://user-images.githubusercontent.com/8971696/183306936-6e5fa96c-42a8-4282-a997-a9ec7ea14883.png
Expected behavior I don't know what they do, but we have to throttle this to once a second max.
Leantime Version 2.2.4 - Docker-compose version
Additional context When a hand full of people are using the system, this could be ignored, but in bigger settings, this would slow everything down.
— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/852, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFQE7XURJGQCXW466V3VYACG7ANCNFSM5525FRZA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Every page, all the time (with and without a modal screen active)
Well... not all the time... only when resizing :-D
Found it. It's in the menu controller javascript that stores whether the left menu is open or not. https://github.com/Leantime/leantime/blob/0d8ec77ae78654191553f0b62ce204e1859487d8/src/domain/general/js/menuController.js#L71
I can't believe no one found that before. This has been working this way for a very long time. (3 years based on git blame)
Good catch!
On Sun, Aug 7, 2022 at 4:22 PM Peter Hulstaert @.***> wrote:
Well... not all the time... only when resizing :-D
— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/852#issuecomment-1207478901, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFW7VXWQH4D3WDDLVGLVYALGRANCNFSM5525FRZA . You are receiving this because you commented.Message ID: @.***>
Glad I can be of help. You really found that fast :-)
Maybe this type of solution might help?
https://stackoverflow.com/questions/5489946/how-to-wait-for-the-end-of-resize-event-and-only-then-perform-an-action
The easiest of them all is this one. This comes down to "if you stop resizing for x ms; do something". So this is kind of an 'end resize' event.
huh, yeah I see it now. It sends requests to api/session . Now let me find the culprit.
On Sun, Aug 7, 2022 at 4:22 PM Peter Hulstaert @.***> wrote:
Well... not all the time... only when resizing :-D
— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/852#issuecomment-1207478901, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFW7VXWQH4D3WDDLVGLVYALGRANCNFSM5525FRZA . You are receiving this because you commented.Message ID: @.***>
Well I just searched for ".resize(" :D
On Sun, Aug 7, 2022 at 4:32 PM Peter Hulstaert @.***> wrote:
Glad I can be of help. You really found that fast :-)
— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/852#issuecomment-1207480469, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFVGEDSI35XV2DBLGL3VYAMN3ANCNFSM5525FRZA . You are receiving this because you commented.Message ID: @.***>