-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
timestamp is not updated when entry changes #2810
Comments
I would like to work on this issue. |
@tobiasdiez I think that it makes sense that @ayanzunaid works on that. I suppose, the code has to be adapted to use our eventing system? |
I took a quick look yesterday and it seems that only the file timestamp is somehow updated (according to the config options), and not the entry timestamp in the main table |
@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. |
hello. i want to help with this issue, but cant find where recent changes in the entry editor saves. |
@ferg35: Nice to hear! The |
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 <notifications@github.com>:
… @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>
.
|
hi |
@bimini94 Yes, please. Go ahead. - I think, the EntryChangedEvent is not fired that often now. I think @lenhard did something there in the context of autosave. |
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.
Created a WIP pull request under the above mentioned assumptions. We have some problems with our new tests being dependent on JabRefPreferences, which is not allowed according to the test TestArchitectureTests#testsAreIndependent(). A more detailed description is given as part of the pull request. |
* 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.
This should be fixed in the latest development version thanks to a fix by @tobous. Could you please check the build from http://builds.jabref.org/master/. Thanks! |
Yeah, it works! Thanks a lot!!! |
JabRef 4.0.0-dev--snapshot--2017-05-01--master--fcac52707
Linux 4.10.12-200.fc25.x86_64 amd64
Java 1.8.0_131
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.
The text was updated successfully, but these errors were encountered: