Delayed Notes Crazy Sorting

Can anyone fill me in on what is going on with the sorting of delayed notes? I can’t make heads or tails of what the sorting algorithm is. I feel like, if it has to sort only one way, with no user control, it should sort with latest (real-time) entry on top.

I searched for other entries on this topic, but couldn’t find any.

I believe the sort order is the order in which the notes were added.

I’ll investigate further if you provide instructions for reproducing the problem you’re seeing.

1 Like

Thank you, I’m attaching an image showing the error. I’ve got lots of entries from a test game I am running. But, I’ve experienced confusion a few times, having lost the message that “should be there”…eventually finding them at the bottom of the list. In the image, you will see the earliest set of entries in the window in the proper order. Then the last five are completely in the wrong place.
image

How do I reproduce the problem?

I just reproduced the problem in a dedicated test module so I could be more precise. It seems that there is a re-ordering that happens when a game is saved and then re-opened. In the test I just ran, I created 15 Delayed Notes, retiring back and forth to each opponent’s side after 1-3 messages…no errors. Then I saved the game and re-opened it. All of the Delayed notes were in reverse order, with oldest on top and youngest on bottom…every new entry I made from there was then created on the top of the list…creating a new proper order on top of the reverse-ordered list. So, we wind up with multiple reverse-ordered lists stacked on top of one another…using Vassal 3.6.6.

FWIW - in V4, it would be nice if the player could select the column to sort by and choose to sort up or down.

I can reproduce the odd ordering. I’m looking into the cause now.

1 Like

This is a one-line change we can make for 3.6.7.

The member function which makes columns sortable didn’t exist prior to Java 6, but we supported Java 5 through 3.2.17 so couldn’t use that function before.

Very awesome, thank you.

Please try the VASSAL-3.6.7-SNAPSHOT-aaff1a0-notes_save_order build for the ordering fix.

The Delayed Notes entries on this build maintain the proper order. The only thing you may wish to address is the fact that loading a previously saved game with a disordered list does not correct the order, even though the human-readable time stamp of the mis-ordered entries appear to be sortable.

Thanks very much for addressing this issue.

Please try VASSAL-3.6.7-SNAPSHOT-953bbe0-notes_table_sort for the column header sorting improvement.

Almost perfect…you can see something weird is still happening in the attached image. Here’s what I think I’m seeing…It is misordered because the sorting algo is only looking at the time-stamp to the minute and ignoring anything past that. Also, it is secretly using the “Note Name” column as the secondary sort field. Therefore, when I sort in reverse order, it looks perfect, but when I sort with latest on top, every entry with the same time-to-the-minute gets ordered by “Note Name”. So, my guess is, the algo truncates the time to the minute. I suspect the underlying data element has more granularity than that.

Nothing finer-grained than minutes is stored. That’s part of the file format, so it’s not something we can change in V3.

1 Like

Ah, well, this is workable. Thank you very much for addressing this. I really appreciate it.