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

Feature request: autosave #344

Closed
vrossum opened this issue Nov 15, 2015 · 20 comments
Closed

Feature request: autosave #344

vrossum opened this issue Nov 15, 2015 · 20 comments
Assignees

Comments

@vrossum
Copy link

vrossum commented Nov 15, 2015

Hi
Currently autosave is active every 5 minutes. Would it be possible to whenever an entry is added?

This would help a lot when one is typing a latex document and needs to include an extra ref in jabref.
Currently one needs to remember to save jabref everytime before running latex.

@stefan-kolb
Copy link
Member

You are talking about an autosave so a Latex run can include the newly created entry inside the references?! If not please clarify your use case.

How should the algorithm detect when you are finished with the entry?
It may save when it has a Bibtex key but might still be incomplete.

I don't see a good algorithm to detect the autosave point. Imho the normal use case should be:

  1. create your entry
  2. save when your done (just CTRL-S for convenient saving)
  3. Insert cite inside Latex document
  4. compile Latex

@tobiasdiez
Copy link
Member

We could consider saving after every edit (maybe as an additional preference option).

@vrossum
Copy link
Author

vrossum commented Nov 16, 2015

Thanks for looking into this.

On 16/11/15 23:22, Stefan Kolb wrote:

You are talking about an autosave so a Latex run can include the newly
created entry inside the references?! If not please clarify your use case.

Indeed.

How should the algorithm detect when you are finished with the entry?
It may save when it has a Bibtex key but might still be incomplete.

I see the problem.
However, I typically search via google scholar or pubmed. In that case
saving after getting the bibtex key would work.

Mark van Rossum, Reader, School of Informatics, U Edinburgh
Forum Rm 2.52, 44-131-6511211

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

@stefan-kolb
Copy link
Member

@JabRef/developers Any comments if we want to change anything or keep the current behavior?

@lenhard
Copy link
Member

lenhard commented Feb 23, 2016

I guess unless @vrossum commits to creating a pull request and implementing the feature, nothing will happen here. At least I do not see any other volunteers.

@vrossum Will you implement this, or can we close the issue?

@obraliar
Copy link
Contributor

The JabRef StuPro feature team will take care of this issue.

@simonharrer
Copy link
Contributor

Hm, to make this a useful feature it should make saving obsolete. Every edit or change should be directly reflected in the persisted the database.

@obraliar
Copy link
Contributor

Now we are collectiong ideas about realizing this. Suggestions are welcome.

@koppor
Copy link
Member

koppor commented Mar 14, 2016

Maybe, it should be possible to turn on and off this feature on demand. If I work on a dropbox shared folder, I don't like that each change is instantly saved in dropbox, do I?

@obraliar
Copy link
Contributor

We just received the message that there are discussions about implementing event system (#937 (comment)). Once this system is implemented the problem will get easier to solve. So we think we should wait, or?

@koppor
Copy link
Member

koppor commented Mar 15, 2016

Initial sketch for the event system (#969) in the context of autosave.

@stefan-kolb
Copy link
Member

Could this potentially make JabRef slow again with large databases?

@obraliar
Copy link
Contributor

So this problem is indepedant of the event system. I think that the save process of large databases takes too long, right? If so, we could implement another save method, which only updates the affected entry instead of overwriting the hole file.

@koppor
Copy link
Member

koppor commented Apr 26, 2016

@obraliar Please follow up at #1103 and #1094. Since bibtex are text files, one cannot easily seek into the file and write a larger portion. Currently, JabRef uses the read serialization if the entry was not changed. Thus, there should be no performance improvement possibilities in that case.

@obraliar
Copy link
Contributor

obraliar commented Jul 13, 2016

This is my imagination of this feature:

  • UI/Preferences:

autosave_mockup

  • Functionality:
    • Event based saving (on EntryEvents, using the existing eventBus)
      • Trigger by EntryAddedEvent, EntryChangedEvent and EntryRemovedEvent.
      • Disable the feature and notify the user when the databse contains more than x entries.
    • Time based saving
  • Decisions:
    • Should we keep the already existing Autosave mode?
      • Should both modes be able to be activated simultaneously?
    • Should we add a new item "Autosave" to the list of the preferences? (There is no place for the UI part above)

Discussions are welcome.

@koppor
Copy link
Member

koppor commented Jul 13, 2016

What is the existing autosave mode?

I would not make "Autosave on every" configurable. It is always saved after each change.

I would not offer the choice between timebased and eventbased. Just eventbased. Or something sensible such as IntelliJ does. The recovery should also be done automatically.

Reason: There should be less configuration possibilities. JabRef should just do it right.

@obraliar
Copy link
Contributor

obraliar commented Jul 13, 2016

What is the existing autosave mode?

Time based autosave already exists.

Okay, in that case I'm going to replace it completely.

Should we provide a differentiation between event types then?

@tobiasdiez
Copy link
Member

I'm also in favor for only supporting event-based auto-save and only the following configuration options:

  • Enable / Disable
  • Disable for huge databases (with a fixed limit which we have determined before)

I think the backup functionality is very important, but of course should be adopted to work with the auto-save method. For example, it is relative pointless to save the same data to two files on every change. Thus I would differentiate between the following two cases:

  • auto-save enabled: make a backup copy on opening the file but don't write changes to it. In this way, we have a backup for the old state and the real file always contains the current state.
  • auto-save disabled: create a backup copy when the file is opened and save all changes to it. Only write to the real file if the user presses save.

So in either case there is a file with the old state and a file with the current state.

@koppor
Copy link
Member

koppor commented Oct 16, 2016

Implemented in #2118 and help pages prepared (https://github.com/JabRef/help.jabref.org/pull/108).

@koppor koppor closed this as completed Oct 16, 2016
@koppor
Copy link
Member

koppor commented Oct 16, 2016

Thank you for reporting this issue. We think, that is now implemented in our development version and consequently the change will be included in the next release.

We would like to ask you to use a development build from https://builds.jabref.org/master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants