I've done more testing, and the pattern is definitely repeatable.  If I 
check out the  ekr-3181-mypy-links branch, the first time I launch Leo the 
workbook may not be affected but every time after that it is destroyed and 
replaced by the default CheatSheet.  When I change back to the devel 
branch, the first launch after that also replaces the workbook, but after 
that the workbook is opened without replacement.  Remember, in these trials 
after each time the workbook gets replaced, I restore it from backup for 
the next launch.

The replacement does not happen if I specify the workbook on the command 
line.  Clearing the recent files list had no effect on the behavior.  
Nether did deleting the .leo\db directory.

On Tuesday, June 27, 2023 at 5:55:37 PM UTC-4 Thomas Passin wrote:

> I haven't filed an issue on this yet because I haven't got all the 
> conditions nailed down.  But Leo has been replacing my workbook with the 
> default CheatSheet ... sometimes.  *Please* make sure you have a backup 
> copy until this gets resolved.
>
> I noticed this behavior while I was testing code with the branch 
>
> Leo 6.7.4-devel, ekr-3181-mypy-links branch, build b9a9205ae9
>
> This is the branch with with all the new unl code.  I'm not sure if it can 
> also occur on the devel branch.
>
> The problem is that this behavior seems to happen suddenly.  Once it 
> starts, every time I launch Leo with this command line, the workbook.leo 
> outline gets replaced:
>
> py -m leo.core.runLeo
>
> If I include the name of the outline the outline does not get replaced:
>
> py -m leo.core.runLeo .leo\workbook.leo
>
> When the outline gets replaced, I noticed that the other outlines that 
> were opened previously did not get opened.  This made me think that the 
> database was getting corrupted.  But I deleted the .leo\db directory and 
> the workbook still got deleted.
>
> I think that something the the experimental branch is corrupting some 
> string, maybe of the recent files list.  This prevents Leo from finding the 
> workbook.  So it creates a new one.  I have observed that changing back to 
> the devel branch does not stop this behavior on the first launch, but after 
> I run Leo once in devel and then restore the workbook from backup, after 
> that Leo behaves normally and does not replace the workbook.  When I switch 
> back to the experimental branch, that's when this problem starts happening 
> again.
>
> I suggest that if Leo cannot find the workbook when it wants to open it, 
> it should notify the user that it can't find it and ask if it should create 
> a default workbook.  The user will probably say "no!" since they will know 
> that they want to keep the existing one.
>
> Of course, the problem should be fixed, but this would prevent the loss of 
> the workbook in case of future bugs as well.  I don't know about you, but I 
> have a lot of work in my workbook that I really don't want to lose.
>
> I was saved by Leo's new automatic backup, so I had a workbook.leo.bak 
> file when I first realized realized the problem. (Yes, I do back up the 
> .leo directory, but not recently enough this time).
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/b9edd250-0a69-413c-b286-2254f0a1ed37n%40googlegroups.com.

Reply via email to