-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Multiple instance recover files #3032
Conversation
This is similar to how Microsoft Word does it, they allow normal operation but put a sidebar with recovery files in it. I'm not sure a red |
The save files for named/saved projects could use the name somehow. Like:
|
No, just don't think there's any way to bring attention to any project icons currently as they live in a collapsed sidebar on a collapsed tree. |
Notification area is fine with me. |
Could a time stamp be used rather than a session hash? I think a time stamp could be more useful, so the users can easily differentiate between the recover files. Also, when you succesfuly recover a project, does the recover file get removed? |
Yes, time stamp sounds good. I think the clock is one second intervals so we would probably have to make it loop until there is sure to be no files with that time already. Tiny odds of that happening but not unimaginable. I like that hash function though... ❤️
Yes. If you discard/save a recover file it's removed. Next time you launch LMMS it will find the next older recover file if there's more than one. |
Thinking about it some more... yeah, it probably is. I'll try and scrap the hash later this evening. |
Timestamp is logical but can quickly get bloated. e.g. And keep in mind if you have a project open for 3 days, it'll be the day it was opened, not necessarily the day it crashed. |
Not if we renew the timestamp on every save. |
Oh and @zonkmachine please enable autosave on by default, if you didn't do already in this PR. I suffered loss of my work in inkscape just because autosave was off by default, I wouldn't want the same to happen to people in LMMS |
This is the main theme of #181 . I agree with this. |
Hmm, now that I think about it, session hashes are not bad. If you want to see when the file was saved, you could look into its properties. If we get the timestamp when opening the project, in case of multitple uses of LMMS, this can get confusing. |
So the plan is to delete and create a new file every second? |
I think I misunderstood this. You mean the computer is up and running for three days? In any case I meant updating the timestamp on every auto save, not every second, so the answer is the same in any case. The save function already starts with an intermediate file |
How do you know a recovery file does not belong to a running instance? A second instance should detect the first one and ask its session ID. |
Recovery files should be created with: QTemporaryFile recoveryFile( "XXXXXX.recover.mmp" );
recoveryFile.setAutoRemove( false ); |
😮 I don't?!
Yes! Does this mean shared memory and semaphores?
I'll look into it. |
I would write the session ID in a file named after the process ID. |
Using |
Can you or @zonkmachine expand on this question? What's wrong with a |
I will look into QTemporaryFile and QUuid . |
Nothing, it is the best solution.
The problem is how you know whether the recovery file ( |
Can the lock file be dual-purpose (mmpz + lock)? Windows allows this, but not sure how POSIX does it. I read somethihg about |
Native lock files may allow this, but |
I wont have time to look into this any further. I suggest that I revert this to only the first commit to remove the limited session which is utterly useless, merge that into stable-1.2, and then someone else can fix the multiple instance recover files for 1.3 ? |
Limited Session is dropped in #3545 and I close this PR for now. |
Fixes #181
Design request. Not ready for code review but I'm curious as to how y'all think the recover file system should behave.
It is currently a working rudimentary implementation of recovery files for multiple sessions.
LMMS is given a unique 8 char hex ID and sticks this to the recover files belonging to the session. On recovery the ID is reused as session ID. The files are sorted so if you have more than one
.recover.mmp
the system will suggest the most recent for recovery.Limited Session is dropped and maybe all sessions should be dropped?
Maybe we shouldn't prompt for recover files at all on program launch but just open up a session and if you had a crash there could be an indicator (red R or something) on the MainWindow, maybe superimposed upon the
open existing project
icon.? Don't know. Ideas?