kitodo-production icon indicating copy to clipboard operation
kitodo-production copied to clipboard

On “System” page, the main menu closes itself

Open matthias-ronge opened this issue 2 years ago • 8 comments

Describe the bug On the “System” page, the main menu always closes very quickly.

To Reproduce Steps to reproduce the behavior:

  1. Go to “System” page
  2. Click on main menu (𓃑).
  3. Try to click something in the menu.

Expected behavior Menu should stay open.

Screenshots Screencast

Release 3.6 release

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox 120.0

matthias-ronge avatar Nov 27 '23 08:11 matthias-ronge

I am unable to reproduce this error. Maybe you just need to clear your browser cache and reload the page including it's resource files like Javascript and CSS to resolve this issue. At least the breadcrumb for "System" implies something like outdated stylesheets.

solth avatar Nov 27 '23 09:11 solth

Refreshing the cache didn’t fix it. Also, the „smaller“ breadcrumbs continue to appear if the window is smaller than 1200 px.

Screencast

The page refresh is actually triggered by clicking on the menu icon, not by the timer page refresh of the task manager, as I did think before. You see it by highlighting some text, or in the network console. It also happens on the „Legal texts“ tab

Screencast2

matthias-ronge avatar Nov 27 '23 10:11 matthias-ronge

When I open the “System” page, everything is normal. Normal mouse pointer, no network activity.

When I click on the main menu, the whole page gets reloaded.

Clearing the browser cache didn’t help.

System: Ubuntu 20.04 Java: OpenJDK 11.0.21 Servlet container: Apache Tomcat 9.0.31 Release: Kitodo.Production 3.6.0 Browser: Firefox 120.0 (all extensions disabled) User: testadmin

Browser console warning:

jQuery.Deferred exception: PF(...) is undefined @http://localhost:8002/kitodo/javax.faces.resource/lists.js.jsf?ln=js:54:20 (jquery.js.jsf:2:31008)
e@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:29453
Deferred/then/l/</t<@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:29755
setTimeout handler*Deferred/then/l/<@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:29964
c@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:27742
add@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:28020
Deferred/then/<@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:30060
Deferred@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:30473
then@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:29989
@http://localhost:8002/kitodo/javax.faces.resource/lists.js.jsf?ln=js:53:13
dispatch@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:42571
add/v.handle@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:40572
EventListener.handleEvent*add@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:41039
Ae/<@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:39656
each@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:2777
each@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:1419
Ae@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:39632
on@http://localhost:8002/kitodo/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=8.0&v=8.0:2:46222
@http://localhost:8002/kitodo/javax.faces.resource/lists.js.jsf?ln=js:52:11
 undefined

matthias-ronge avatar Nov 30 '23 08:11 matthias-ronge

The code in question is here:

Screenshot 2023-11-30 091146

matthias-ronge avatar Nov 30 '23 08:11 matthias-ronge

I temporarily fixed this problem …

$(window).on("load", function () {
    $.ready.then(function () {
      if (typeof PF === 'function') {
        if (typeof PF('processesTable').selection !== "undefined" && (PF('processesTable').selection[0] === '@all' || PF('processesTable').selection.length === PF('processesTable').cfg.paginator.rowCount )) {
            PF('processesTable').selectAllRows();
            PF('processesTable').selection=new Array("@all");
            $(PF('processesTable').selectionHolder).val('@all');
            let excludedIds = $('#excludedProcessIds').children();
            for(let i = 0; i < excludedIds.length; i++) {
                let processId = excludedIds.get(i).textContent;
                PF('processesTable').unselectRow($('tr[data-rk="' + processId + '"]'), true);
            }
        }
      }
    });
});

The warning is gone, but the behaviour is still the same. So this seems not to be the problem

matthias-ronge avatar Nov 30 '23 08:11 matthias-ronge

JSF decides for some reason, that the whole page needs to be updated. XHR response starts with:

<?xml version="1.0" encoding="UTF-8"?><partial-response id="j_id__v_0"><changes><update id="javax.faces.ViewRoot"><![CDATA[<!DOCTYPE html> …

XHR POST data:

{
	"javax.faces.partial.ajax": "true",
	"javax.faces.source": "dashboard-menu",
	"javax.faces.partial.execute": "@all",
	"dashboard-menu": "dashboard-menu"
}

I wonder why opening the menu fires a HTTP request at all. It should only make the menu visible …

matthias-ronge avatar Nov 30 '23 08:11 matthias-ronge

I was able to reproduce the error now. My observation is that it only occurs if the indexing on the system page has been started, because this triggers a continuous polling of the page (for progress updates) that is not stopped even when the indexing is finished. Could that explain the behavior you reported?

You could easily check this by renewing your session (logout + login) and opening the system page again. If you do not start the indexing the error should not occur anymore.

solth avatar Dec 07 '23 10:12 solth

The code in question is here:

Screenshot 2023-11-30 091146

@matthias-ronge could you check if #5868 fixed the problem?

solth avatar Jan 08 '24 08:01 solth

I can no longer reproduce the problem with the current master. I am closing this issue.

matthias-ronge avatar Jun 18 '24 09:06 matthias-ronge