-
Bug
-
Resolution: Fixed
-
Normal
-
3.8.1
-
Security Level: Jimmy
-
Sprint 2
Problem description
A user encounter the "unresponsive script error" with Firefox:
- they are seeing a problem when trying to render/update cells after we populate the data to a sheet.
- they are using a process queue on the server side and then when the data is sent back to the client, the show busy spinner pauses, and then before all the cells can update, we get the browser's unresponsive script error. If you continue, you get a few more cells updated.
- This particular book has 1 sheet tab with 600 cells that need to be updated when the server sends back the data.
- This took about 5 secs to get the data and render it to the page when using ZSS 2.6.
Steps to reproduce
- run attached files and visit it with Firefox
- Click "populate data" button. It's implemented by the echo event. The "unresponsive script warning" should appear.
- Click "populate data - event queue" button. The warning should not appear.
Debug information
- When unresponsive script warning shows, the response size is relative larger than normal e.g. 2000 cells, 9506k, response array size: 8000
- call notifyChange() doesn't eliminate the issue
@Listen("onPopulate= #ss") public void populate(Event e) throws InterruptedException{ populateData(); Clients.clearBusy(); Ranges.range(ss.getSelectedSheet()).notifyChange(); // add this line doesn't eliminate the issue nor reduce the response size }
Workaround
Perform a heavy operation in an event queue
queue.subscribe(new EventListener<Event>() { @Override public void onEvent(Event e) throws Exception { performHeavyOperation(); } }, new EventListener<Event>() { @Override public void onEvent(Event e) throws Exception { //access a spreadsheet component Ranges.range(spreadsheet.getSelectedSheet()).notifyChange(); Clients.clearBusy(); } }); //an event listener to trigger the @Listen("onCellClick = #spreadsheet") public void onCellClick(CellMouseEvent event){ queue.publish(new Event("onStart")); Clients.showBusy("busy..."); }