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

Restore previous session does not work with forced shutdown #47

Open
travankor opened this issue Aug 31, 2018 · 5 comments
Open

Restore previous session does not work with forced shutdown #47

travankor opened this issue Aug 31, 2018 · 5 comments

Comments

@travankor
Copy link

Brief description of the issue.

Textosaurus restores the previous session of all file tabs when textosaurus is closed gracefully. However, when a forced shutdown/restart occurs, textosaurus can not restore previous session.

How to reproduce the bug?

  1. Enable restore previous session in settings.
  2. Open several files.
  3. Instead of gracefully closing the window, restart the computer.
  4. Start textosaurus on the next reboot.

What is the expected result?

On the next launch, textosaurus will launch all saved and unsaved tabs.

What actually happened?

On the next launch, textosaurus loses the state of all tracked tabs and launchs with a new text file tab.

Other information (logs, see Wiki)

N/A

@martinrotter
Copy link
Owner

Yes, at this point list of currently opened documents as persistently saved when application exits. If PC gets restarted or application crashes, then session is not stored.

Perhaps I could store session not only when app gracefuly quits but also when one of these events occurrs:

  • new document is opened
  • some document is closed or saved
  • order of tabs is changed

@travankor
Copy link
Author

Those bullet points sound like a nice idea to implement.

Something that I don't like in the current behavior is that a previously saved session can be replaced by a blank session (new text file). Maybe there is a way to store old sessions and let the user choose a specific session?

@martinrotter
Copy link
Owner

Maybe there is a way to store old sessions and let the user choose a specific session?

No, not yet.

@martinrotter
Copy link
Owner

I am thinking deeply about this. I mean, I can certainly implement this "auto-saving" of session on these events:

  • new document is opened
  • some document is closed or saved
  • order of tabs is changed

This is ok, but what if user has opened and MODIFIED some files. Now, auto-save of sessions runs -> file is modified, should it ask user if he wants to save it? No, it cannot, the "auto-saving" of session should be able to run without user interaction. It would disturb user if it asked him all the time about saving.

So my conclusion is, that "auto-saving" of session should not actually "save" modified files but only store list and order of opened files just to be sure that when textosaurus crashes, then list of opened files is maintained.

Of course that this feature would work nicer if it was paired with periodic "auto-save" feature which will really save even contents of modified files regularly.

What you think?

@travankor
Copy link
Author

travankor commented Nov 21, 2018

Yes, I think auto-saving the actual file should be separate from saving the session.

That said, if the application crashes and there are modified files, those modified files should be saved to the disk if possible.

This is ok, but what if user has opened and MODIFIED some files. Now, auto-save of sessions runs -> file is modified, should it ask user if he wants to save it? No, it cannot, the "auto-saving" of session should be able to run without user interaction. It would disturb user if it asked him all the time about saving.

Of course that this feature would work nicer if it was paired with periodic "auto-save" feature which will really save even contents of modified files regularly.

Yes, this sounds like a separate feature. Maybe make the auto-save timer configurable (every 30 seconds to 15 minutes all modified files get written to disk, or something like that).

So, autosaving the session should involve:

  • document is opened
  • document is closed
  • order of tabs is changed

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

2 participants