Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
timestamp is not updated when entry changes #2810
as noted in the opening post of #2808, in my version the timestamp is not updated. even though I configured it to be updated (and it worked in recent versions)
The user experience is related to #2812: to some degree the changed timestamp is simply not immediately shown.
However, for some entries (and I do not recognise a pattern yet) the timestamp is not updated at all (i.e. even no change of timestamp after change and save and restart of jabref.
@ayanzunaid you are of course welcome to work on it. The root of the issue is probably that the doUpdateTimestamp method is no longer called with the recent changes in the entry editor.
Feel free to ask for further help if you get stuck at some point.
@ferg35: Nice to hear!
The problem is with the EntryChanged event, it is fired even when you just enter one new character or delete one in one entry. So the frequency is very high 2017-06-27 11:50 GMT+02:00 Tobias Diez <firstname.lastname@example.org>:…
@ferg35 <https://github.com/ferg35>: Nice to hear! The EntryChangedEvent is issued after an entry changed (see [here]( https://github.com/JabRef/jabref/search?utf8=%E2% 9C%93&q=EntryChangedEvent+&type=r for a list of uses of this class). You can subscribe to these events similar to the SearchAutoCompleteListener <https://github.com/JabRef/jabref/blob/52b887dd1b6a11f3a2d02eb592a718fe575c6962/src/main/java/org/jabref/gui/BasePanel.java#L2106>. As I said above, I wouldn't tie the update to the entry editor since entries can be changed also on other means (e.g. cleanup). — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#2810 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AATi5CB122XTPQBWP6WRkGaH9egdBo_4ks5sINB_gaJpZM4NNTIO> .
We had a look at the problem. The needed functionality seems to already be present in EntryEditor.StoreFieldAction#updateTimeStamp(UndoableEdit). The problem is that the class EntryEditor.StoreFieldAction is never used. Furthermore, the EntryEditor is no longer registering the annotated "@subscribe" methods after commit 42ea6bc (which is part of a fix for issue #3366).
We would like to follow the given suggestions and create a listener on EntryChangedEvent which is listening on the whole database.
Furthermore, we would like to address the frequency of fired events: During our tests, the EntryChangedEvent was still fired with every added (or removed) character. We haven't seen any events triggered in any other context (for example by autosaves). But we did not do very extensive testing, so this doesn't have to mean much.
This is a fix for the issue JabRef#2810. The functionality has been moved from the EntryEditor to the BasePanel class so that it can listen for EntryChangedEvents on the whole database instead of specific EntryEditor objects. This allows us to also update the timestamps of entries that were changed by other sources (like cleanup operations). The inner class UpdateTimestampListener is defined as "public static" so that it can be used in the test cases for the implemented functionality.
* Fix timestamps not being updated for changed entries This is a fix for the issue #2810. The functionality has been moved from the EntryEditor to the BasePanel class so that it can listen for EntryChangedEvents on the whole database instead of specific EntryEditor objects. This allows us to also update the timestamps of entries that were changed by other sources (like cleanup operations). The inner class UpdateTimestampListener is defined as "public static" so that it can be used in the test cases for the implemented functionality. * Add tests for UpdateTimestampListener * Move UpdateTimestampListenerTest to gui package * Move UpdateTimestampListener into separate class * Fix assertions for Optional values in UpdateTimestampListenerTest * Add blank lines in UpdateTimestampListenerTest The blank lines should help differentiate between the constants that the test cases share and the constant that is different in both test cases. * Move shared calls into setup in UpdateTimestampListenerTest This only applies to shared calls that are not dependent on the used constants. As these constants define the values used in each test, they are kept in each test case to improve readability. This also applies to constants that have the same value in all tests. * Use camel case for constants in UpdateTimestampListenerTest * Add UpdateTimestampListenerTest to architecture test exceptions This allows the added test cases to be dependent on JabRefPreferences without causing TestArchitectureTests#testsAreIndependent() to fail. The exception is warranted as the tested functionality is dependent on JabRefPreferences and the test cases mock all calls to it.