RJTe Bug: Editor improperly closed - Do you wish to recover

Report issues, odd behaviors or submit a detailed bug report.
User avatar
yereverluvinuncleber
Posts: 368
Joined: 20 Apr 2018 09:49

RJTe Bug: Editor improperly closed - Do you wish to recover

Post by yereverluvinuncleber »

I am seeing this message quite a lot "Editor improperly closed - Do you wish to recover documents".

I always say NO as I am quite aware that I am not closing documents improperly. It seems to happen too often to be a feature of the way I operate.

I have 63 RJ projects and I open two or more a day and I'll fix something here or there. I save all open documents and then commit the changes to github. Nothing is ever left open or uncommitted. Later on I may close the RJTextEd window and the project files therein when I need screen space &c.

I will close the project in two ways, if the editor window is off the right of the screen I will dblClick the top left icon.
Alternatively, I will click the top right X. I will never select File / Exit in RJTe - and that is the same way I handle ALL my apps and always have, ever since the days of Windows 1.0 and even before on other Windowed interfaces. No other editor or app gives me this sort of message when restarting, only RJTe.

So, there is something in RJTextEd that thinks a normal application terminate is an abnormal termination.

This causes two problems, first it leads to me to suspect there is something wrong with my project - and there isn't... that's confusing.

Secondly, when I am opening a project and this message appears, it has nothing to do with the current project but is, in fact in relation to the last project closed. That may be any other project. If say 'yes' to the recover then it opens my project and a mix of files from the previously project - which is a confusing no-no.

I suggest you change any detection of an abnormal termination to only throw an "Editor improperly closed" dialog in context with the current project being opened. Better still, alter the rules by which RJ perceives an abnormal shutdown and handles an external 'kill' with greater aplomb and less worry.

I suppose this is a change request wrapped around a feature that seems to be a bug. I'll let you choose.

PS Thanks for the fast turnaround.
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/
User avatar
pjj
Posts: 2130
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by pjj »

This happens to me almost all the time (or maybe just all the time) when I close Windows without manually closing RJ TE.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
yereverluvinuncleber
Posts: 368
Joined: 20 Apr 2018 09:49

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by yereverluvinuncleber »

I haven't closed Windows for a month...
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/
User avatar
Rickard Johansson
Site Admin
Posts: 6628
Joined: 19 Jul 2006 14:29

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by Rickard Johansson »

A debugOut.txt file, when this happens, would be helpful viewtopic.php?t=1605. You should probably use the "Append" option.

If you can replicate it at will - maybe tell me what files are inside the <AppData>\Roaming\RJ TextEd\temp folder, when you close the program.

If there are any files in the temp folder e.g. _left.txt - that will indicate that something went wrong when closing the program.
User avatar
pjj
Posts: 2130
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by pjj »

Rickard Johansson wrote: 05 Jul 2023 17:11 If you can replicate it at will -
Image

First off, I have placed DebugOut.txt as per your instructions, but no log file was produced :?
Rickard Johansson wrote: 05 Jul 2023 17:11 maybe tell me what files are inside the <AppData>\Roaming\RJ TextEd\temp folder, when you close the program.

If there are any files in the temp folder e.g. _left.txt - that will indicate that something went wrong when closing the program.
There are all the files that were open in RJ TE when I closed Windows, and also _project.txt & _left.txt.

Btw, why is DebugOut.txt file required, can't this be read from TextEd.ini and switched on/off from within the program itself?

Btw 2, what's the difference between "Tak" (Yes) and "Yes to All"? I always click on "Tak".
not-closed-properly.png
not-closed-properly.png (5.12 KiB) Viewed 2186 times
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6628
Joined: 19 Jul 2006 14:29

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by Rickard Johansson »

It was meant for yereverluvinuncleber.

I already know what happens when you close Windows with the program still open.

The "Yes to All" option will disable the option to display the prompt at all, so if pressed - you should never have to see it again.
User avatar
yereverluvinuncleber
Posts: 368
Joined: 20 Apr 2018 09:49

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by yereverluvinuncleber »

Will do, cannot recreate at will, it happens only at times - but it is regular.

Just this evening I opened a project using a link to the rproj file and then opened the same rproj file almost immediately afterwards - by mistake - to end up with a second instance of the project. As the 2nd instance opened, it popped up the same "Editor improperly closed - Do you wish to recover?" dialog. As far as I was aware no changes had been made to any files.

Next time it occurs, Ill try to obtain some debug information.
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/
User avatar
DerellLicht1
Posts: 144
Joined: 23 Jul 2021 17:38
Location: Fremont, CA, USA

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by DerellLicht1 »

This is interesting... I had reported this issue a couple of years ago...

I keep RJTE open at all times; at a minimum, I have an x.txt file where I just past random scraps of data that I want to convert to text...
So whenever Windows decides it needs to reboot, I would have this issue...

But @rickard fixed this issue for me long ago; I no longer see this problem with the current editor...
Note: even if the machine crashes completely, and I have to power-cycle the machine, RJTE is happy and loads just fine...
(yeah, I have a couple of games that do this, once in awhile...)

Actually, I occasionally get this question dialog, but either way, it restores my exact status with no issues...
It's interesting that others are now seeing this issue...
User avatar
pjj
Posts: 2130
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by pjj »

DerellLicht1 wrote: 05 Jul 2023 23:56 But @rickard fixed this issue for me long ago; I no longer see this problem with the current editor...
And that's the thing: he fixed it for you, and now he needs to fix it for me 8)

It seems that, as per Rickard's comment, you (once) clicked on "Yes to All", while I, not knowing what it does, preferred to click on "Yes" -- so for you the editor always assumed the answer and just loaded your files without you even realizing something is going on, while for me the editor always assumed nothing and showed me dialog window.

(Is it the same bug, though? I'm talking here about the editor acting strangely on normal Windows shutdown. I would assume, perhaps erroneously, that it repeats the same behavior as when you explicitly close the program.)
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6628
Joined: 19 Jul 2006 14:29

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by Rickard Johansson »

The editor will always re-open files and project (or display a prompt) if you restart Windows and the program is still running. This is normal behavior. And I think most other editors do the same.
The prompt message and buttons may a bit confusing though and could be made more intuitive. Maybe we don't really need a message, because nothing has actually gone wrong.

In yereverluvinuncleber's case I think several things are happening that shouldn't. E.g. Open a project from commandline (or from Explorer context menu) and restoring the old project at the same time, because something may have gone wrong when closing the program.
User avatar
pjj
Posts: 2130
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by pjj »

It is indeed confusing for me, because I always assumed that when shutting down, Windows sends a signal to all open programs "We're closing, folks", and then all programs close normally, asking "Do you want to save unsaved file?" etc. And in my case there were never any files in need of saving, so I always understood it was a proper closing (so no files should be saved in /temp dir in the first place).
Rickard Johansson wrote: 06 Jul 2023 10:21 Maybe we don't really need a message, because nothing has actually gone wrong.
Indeed. But will the files be restored if I delete them from /temp folder before opening RJ TE after a Windows shutdown?
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6628
Joined: 19 Jul 2006 14:29

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by Rickard Johansson »

pjj wrote: 06 Jul 2023 11:03 "We're closing, folks", and then all programs close normally, asking "Do you want to save unsaved file?" etc.
Programs should not do that when windows is restarted or closed down. Each process is only given a small amount of time to close. If windows decide a process is taking to much time (like displaying user prompts) - it may simply kill the process. So we need to do things quickly.

The editor can edit both local and remote files. There is just no way the program can save them properly when windows is restarting. Information needs to be stored in a local folder, for speed.

Other editors may not show any prompt message though. Sublime, for instance, simply close when windows is restarted. And it restores all previously open files when you start the program. No prompt or message is ever displayed.

I'll see if I can make some changes in the next release (15.91).
User avatar
yereverluvinuncleber
Posts: 368
Joined: 20 Apr 2018 09:49

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by yereverluvinuncleber »

FYI, I open my projects in one of two ways, which may be causing the problem.

I have all my .rjproj files in one location ( I want to change this later but that is how it is at the moment)

I have a folder of shortcuts on the desktop, one to each .rjproj file. When I want to open a .js project I click on the dock entry that opens that folder.

Image

Then I see all my .js projects.

Image

I dblClick on my chosen project shortcut and it opens with all my files loaded and ready to edit.

Second Method: In all of my programs I have a right click menu option that is the direct path to that .rjproj file.
Edit widget using "E:\dean\steampunk theme\Panzer Clock Widget.rjproj"

When the user selects that menu option the program performs a runCommandInBg function that runs a shell command to initiate the stored command.

In both methods, Windows knows about the .rJProj file association and starts up RJtextEd.
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/
User avatar
Rickard Johansson
Site Admin
Posts: 6628
Joined: 19 Jul 2006 14:29

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by Rickard Johansson »

Made the following changes to the next release:

Windows shutdown, restart, logoff
Made some changes at windows shutdown, restart and logoff when the program is still running.

All files should be reopened, silently, when the program is restarted.

Project should be reopened as well, unless you are opening a new one from command-line. In which case the new project is opened, but all previously opened files are opened as well.


That should help a little, I think.
User avatar
yereverluvinuncleber
Posts: 368
Joined: 20 Apr 2018 09:49

Re: RJTe Bug: Editor improperly closed - Do you wish to recover

Post by yereverluvinuncleber »

We shall give it a go, and test. Thankyou.
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/
Post Reply