Skip to content
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

Delay map update when visible #1743

Merged
merged 29 commits into from
Oct 17, 2023
Merged

Delay map update when visible #1743

merged 29 commits into from
Oct 17, 2023

Conversation

patrickdalla
Copy link
Collaborator

This branch is for master. A correspondent branch for 4.1.x was created: DelayMapLoad_4_1_x

patrickdalla and others added 18 commits June 29, 2023 14:54
ends loading, avoiding checked marks sync attempt before marks reload
finishes.
last TableModelEvent of multiple items check event.
@felipecostadesousa
Copy link
Contributor

Hello @patrickdalla, I tested this pull request last week and just found some erros in the map display. Basically when you select more than 1 gps locations in the map display and then you click in a previous selected location, the checked event disappears and the mark is not sync anymore. Here is the video I recorded showing some exemples of that mistake.
https://github.com/sepinf-inc/IPED/assets/81444931/224f2cf0-e875-4eb0-8977-21ce2536c18b
I don't know if I was clear with the explanation, but @lfcnassif confirmed that this behavior was weird.
Thank you =).

@patrickdalla
Copy link
Collaborator Author

patrickdalla commented Aug 2, 2023 via email

@lfcnassif
Copy link
Member

Thanks @felipecostadesousa for helping to test this. When you finish, please I would like your help to test #1669.

@patrickdalla
Copy link
Collaborator Author

Hello @felipecostadesousa. I found one error. I pushed the correction. Please, test it to assure it solved the popup checkbox issue.

@lfcnassif
Copy link
Member

lfcnassif commented Oct 13, 2023

Just tested this, I got 2 kind of exceptions in UI log:

java.lang.NullPointerException
	at iped.geo.impl.AppMapPanel.accept(AppMapPanel.java:340)
	at iped.geo.impl.AppMapPanel.accept(AppMapPanel.java:50)
	at iped.geo.js.GetResultsJSWorker.done(GetResultsJSWorker.java:79)
	at java.desktop/javax.swing.SwingWorker$5.run(Unknown Source)
	at java.desktop/javax.swing.SwingWorker.doneEDT(Unknown Source)
	at java.desktop/javax.swing.SwingWorker$2.done(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.finishCompletion(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.cancel(Unknown Source)
	at java.desktop/javax.swing.SwingWorker.cancel(Unknown Source)
	at iped.geo.impl.AppMapPanel.updateMap(AppMapPanel.java:245)
	at iped.geo.impl.MapViewer.tableChanged(MapViewer.java:144)
	at java.desktop/javax.swing.table.AbstractTableModel.fireTableChanged(Unknown Source)
	at java.desktop/javax.swing.table.AbstractTableModel.fireTableDataChanged(Unknown Source)
	at iped.app.ui.UICaseSearcherFilter.done(UICaseSearcherFilter.java:336)
	at java.desktop/javax.swing.SwingWorker$5.run(Unknown Source)
	at java.desktop/javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
	at java.desktop/sun.swing.AccumulativeRunnable.run(Unknown Source)

And:

java.lang.IndexOutOfBoundsException: Invalid index
	at iped.app.ui.parallelsorter.ParallelRowSorter.convertRowIndexToModel(ParallelRowSorter.java:526)
	at java.desktop/javax.swing.JTable.convertRowIndexToModel(Unknown Source)
	at iped.geo.impl.MapViewer$2.run(MapViewer.java:210)
	at iped.geo.impl.AppMapPanel.runAfterLoad(AppMapPanel.java:389)
	at iped.geo.impl.MapViewer.valueChanged(MapViewer.java:242)
	at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
	at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
	at java.desktop/javax.swing.DefaultListSelectionModel.setValueIsAdjusting(Unknown Source)
	at java.desktop/javax.swing.JTable.clearSelectionAndLeadAnchor(Unknown Source)
	at java.desktop/javax.swing.JTable.sortedTableChanged(Unknown Source)
	at java.desktop/javax.swing.JTable.tableChanged(Unknown Source)
	at java.desktop/javax.swing.table.AbstractTableModel.fireTableChanged(Unknown Source)
	at java.desktop/javax.swing.table.AbstractTableModel.fireTableDataChanged(Unknown Source)
	at iped.app.ui.UICaseSearcherFilter.done(UICaseSearcherFilter.java:336)

@patrickdalla, when you have time, could you take a look?

@lfcnassif
Copy link
Member

The NPE above is caused by "Clear all Filters" button. I tried a trivial fix to avoid the NPE, but the "Clear all Filters" action is not working, the Map remains with the previous result set, so I'll defer to you @patrickdalla to do a proper fix, since I think it is related to changes in this PR.

@lfcnassif
Copy link
Member

Another error:

java.lang.IndexOutOfBoundsException: Invalid index
	at iped.app.ui.parallelsorter.ParallelRowSorter.convertRowIndexToView(ParallelRowSorter.java:505)
	at java.desktop/javax.swing.JTable.convertRowIndexToView(Unknown Source)
	at iped.geo.impl.AppMapPanel.getItemPositioninResultsTable(AppMapPanel.java:455)
	at iped.geo.impl.AppMapMarkerEventListener.onClicked(AppMapMarkerEventListener.java:26)
	at iped.geo.openstreet.MapCanvasOpenStreet$9.run(MapCanvasOpenStreet.java:453)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
	at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

@patrickdalla
Copy link
Collaborator Author

patrickdalla commented Oct 13, 2023 via email

updateFileListing after removing all the filters. This is necessary to
avoid calling updateFileListing when the filters removal is done by the
Clear Filters button, as the updateFileListing is already called at the
end of all filterer panel specific filters clearing.
triggered before the first had ended, the first was cancelled but the
null result was passed to the accept method leading to the print of a
NullPointer exception in IPED log.
RowSorterTableDataChange with null in sort keys, as this is triggered in
a intermediary operation, that will be triggered again at the end of the
file listing update.
@patrickdalla
Copy link
Collaborator Author

The first NullPointerException reported was being cause by an intermediary updateFileListing, called by Iped timeline clearFilter method, although it is called again at the end of all filters from IPED UI filterers being cleared. As part of the map update is done in background thread, the first updateFileListing was triggering a map update that was cancelled by the next updateFileListing. This was leading to a null object as result. And this null object wasn't being correctly handled. This was solved by previous commits.

@lfcnassif
Copy link
Member

Great, thanks @patrickdalla for investigating and fixing it!

selected, which avoids java.lang.ArrayIndexOutOfBoundsException
throwing.

Merge branch 'DelayMapUpdateWhenVisible' of
https://github.com/sepinf-inc/IPED.git into DelayMapUpdateWhenVisible
selected, which avoids java.lang.ArrayIndexOutOfBoundsException
throwing.
@patrickdalla
Copy link
Collaborator Author

Some of the IndexOutOfBoundsException occurs because of the lead selection cleaning on the results table and the old bad treatment of this condition by the methods getTrackSiblings and getSelectedJSONFeature. They were corrected by last 2 commits.

Corrects treatment of this result on calling codes.
@patrickdalla
Copy link
Collaborator Author

The last IndexOutOfBoundsException occurred when the old lead selection id does not exists in the new result set. The method getItemPositioninResultsTable now returns -1 when this condiction occurs and the calling codes were changed to treat better this condition.

Copy link
Member

@lfcnassif lfcnassif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @patrickdalla!

@lfcnassif lfcnassif merged commit 472b594 into master Oct 17, 2023
2 checks passed
@lfcnassif lfcnassif deleted the DelayMapUpdateWhenVisible branch October 17, 2023 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants