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

[bug][1.35][debian][severe] Geany delete file-entries from the project if files cannot be found #2155

Closed
StrayFeral opened this issue May 14, 2019 · 4 comments

Comments

@StrayFeral
Copy link

StrayFeral commented May 14, 2019

PROBLEM:

Upon opening a Geany project, if some of the files cannot be found:

  1. No error message is generated, the status tab shows message not listing what was not opened
  2. Upon Geany exit (or project close, then geany exit), the actual project file is updated and the files which are not found get deleted from the project file files list
    This way, both the user is not aware what went wrong AND the user loses files from the project.

I non-stop work with locally mounted remote filesystems and this issue is already really bothering, as connection sometimes just drops or simply sometimes I forget to mount the partitions. Either way, it's painful. I currently make backup of all my project files, as a workaround and restore the damaged project, if needed.

PROPOSED SOLUTION -- Geany must NOT automatically decide what to do:

  1. The status tab should show message exactly which files were not opened
  2. There must be a pop-up dialog:
    2.1. Displayed message saying like "Some files cannot be opened" (maybe show list of the files, along with paths, preferably in a text area, so these could be copied in the clipboard, for troubleshooting purpose)
    2.2. Button: "Retry"
    In case files are on a remote filesystem and the partition was unmounted for some reason, user could mount the partition again and given the option to retry opening all missing files.
    2.3. Button: "Cancel"
    If "Cancel" is selected, nothing is re-opened, but also -- the project file must NOT be updated
    2.4. Button: "Skip files and save project"
    If this is selected, then the user chooses clearly both to lose the files from the project and have the project updated that way.

DETAILS:

I observed this issue with few previous Geany versions, but let's test with 1.35 (currently the last one).

My case is that the project files were on a locally mounted remote filesystem and then at some point the partition was not mounted, when this was observed. However I suspect, the same will happen if files are local, just missing.

Environment:

  1. Debian 9
  2. Lxde
  3. sshfs installed
  4. remote filesystem mounted on /mnt/abc

Steps to reproduce:
0. Mount a remote filesystem with sshfs:
sudo sshfs -o allow_other myuser@somehost:/abc/bcd/abc /mnt/abc

  1. Open Geany
  2. Open some files from the mounted partition
  3. Open few files from a local partition too
  4. Create new project with the currently opened files and make sure the project file is saved in the default geany project directory
  5. Close the project
  6. Close Geany
    OBSERVE:
    The project file exists in the default geany directory /home/myuser/projects, open the file with (cat/vi/whatever) and see all files from the project are listed in the file
  7. Unmount the mounted partition from Step 0.
  8. Open Geany
  9. Open the project created in Step 4. (use either Main Menu > Project > Open OR open it from the recent projects list)
    OBSERVE:
    Only the files from the local partitions are opened. Status tab shows message "Failed to load one or more session files."
  10. Close the project (or directly close Geany)
  11. Close Geany
    OBSERVE:
    While the project file still exists in /home/myuser/projects, it does not contain anymore the files from the remote partition from Step 2.

$ geany -V
geany 1.35 (built on 2019-04-29 with GTK 2.24.31, GLib 2.50.3)
$ geany -v
Geany-INFO: Geany 1.35, en_CA.UTF-8
Geany-INFO: GTK 2.24.31, GLib 2.50.3
Geany-INFO: System data dir: /usr/local/share/geany
Geany-INFO: User config dir: /home/eantonov/.config/geany
Geany-INFO: System plugin path: /usr/local/lib/geany
Geany-INFO: Added filetype Cython (61).
Geany-INFO: Added filetype JSON (62).
Geany-INFO: Added filetype Arduino (63).
Geany-INFO: Added filetype Clojure (64).
Geany-INFO: Added filetype Genie (65).
Geany-INFO: Added filetype Scala (66).
Geany-INFO: Added filetype Graphviz (67).
Geany-INFO: Added filetype CUDA (68).
Geany-INFO: Loaded libvte from libvte.so.9
Geany-INFO: Loaded: /usr/local/lib/geany/addons.so (Addons)
Geany-INFO: Loaded: /usr/local/lib/geany/htmlchars.so (HTML Characters)
Geany-INFO: Loaded: /usr/local/lib/geany/lipsum.so (Lipsum)
Geany-INFO: Loaded: /usr/local/lib/geany/pairtaghighlighter.so (Pair Tag Highlighter)
Geany-INFO: unknown : None (UTF-8)
Geany-INFO: Quitting...

@elextr
Copy link
Member

elextr commented May 15, 2019

First, thank you for the comprehensive report with all the information we normally have to ask for.

You noted that this has been the behaviour of Geany projects for some time. That is because it is the intended behaviour. You see, a Geany "project" is nothing much more than a named session file, it keeps a list of a few settings and the files open. Therefore if a file in the list does not open it should be removed from the list.

So a Geany "project" is not like projects in Visual studio and some other IDEs where they need to know all files in the "project" to provide some extra functionality, like symbol management or build management. To get something like those sorts of functionality you can try the project plugins (there are several).

@ntrel
Copy link
Member

ntrel commented Jun 8, 2019

The status bar shows Failed to load one or more session files. Those files are shown in Help->Debug Messages. You could then either kill geany, mount and relaunch (or you could copy the .geany project file to a temporary file, close the project, mount the drive, copy the project file back and re-open).

@elextr
Copy link
Member

elextr commented Jun 8, 2019

Just to note when @ntrel says kill that does not mean close normally, if Geany is closed normally it will write over the project file.

@elextr
Copy link
Member

elextr commented Jun 8, 2019

Closed intended behaviour.

@elextr elextr closed this as completed Jun 8, 2019
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

3 participants