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

Notes with question marks in their names can't be edited and aren't saved #486

Closed
Karig-zz opened this Issue Jan 21, 2017 · 8 comments

Comments

Projects
None yet
2 participants
@Karig-zz

Karig-zz commented Jan 21, 2017

I'm running QOwnNotes 17.01.7 on Linux Mint 17.3. (I have the "Allow note file name to be different from headline" option turned off. Also note: I'm not backing up my notes to an ownCloud account.)

Question marks are of course forbidden in filenames, but sometimes it's tempting to use a question as a note title. Unfortunately QOwnNotes doesn't react gracefully if you do that. To reproduce the issue I had this evening:

  1. Create a new note (Ctrl-N) in QOwnNotes. RESULT: New note appears, with a timestamp for the name. Also, the new note file appears in the folder.

  2. Change the name (headline) in the editor to, say, "Note name with question mark?" RESULT: The new note file is deleted; it isn't renamed to, say, "Note name with question mark%3D.md" (if you were to adopt URL encoding to deal with troublesome characters). However, as long as "Note name with question mark?" is still the current note, you can type more text into the note. (Obviously you could also get your note file back simply by removing the question mark from the headline.)

  3. If you leave the question mark in the headline, wait for the note file to disappear from the folder, then select another note, the note with the question mark is not removed from the note list, so you can select it again. If you do, though, you can't edit the note --- clicking in the editor doesn't make the cursor appear in the text, and typing doesn't change the text. If you were to quit QOwnNotes at this point, you'd lose the note altogether, simply because of that question mark.

However, you can still select the text, so to avoid losing the note, you can select all of the text, copy it, create a new note, paste in the text, and remove that pesky question mark from the headline.

@pbek

This comment has been minimized.

Owner

pbek commented Jan 21, 2017

Thank you for reporting, so far I couldn't reproduce that on macOS. I guess that's an operating system / file system limitation. Do you use an other 3rd party sync tool that might remove the file?

@pbek

This comment has been minimized.

Owner

pbek commented Jan 21, 2017

I now tested it under Manjaro Linux. When using a question mark in the name in a note folder, that is managed by an external sync tools it got removed (I guess by the ownCloud client). When using in a folder somewhere else I had no problems with it. The note got saved and I could open it with an external editor.

@Karig-zz

This comment has been minimized.

Karig-zz commented Jan 21, 2017

I'm not using any other sync tool with QOwnNotes. I have Dropbox, but the notes aren't in Dropbox; they're in a folder on a secondary drive (actually a MicroSD card with a FAT32 filesystem, which [I forgot] can't deal with filenames with question marks, slashes, or double quotes).

@pbek

This comment has been minimized.

Owner

pbek commented Jan 21, 2017

I'm not sure how QON should handle issues with various file systems since it doesn't even know the file-system...
Do you get an error message in the log panel?

@Karig-zz

This comment has been minimized.

Karig-zz commented Jan 21, 2017

I tried it again with the log panel open: I created a new note, then renamed it to "Question?". After a moment, the note's name was updated in the note list, and the log panel showed this:

[11:23:58] [critical] "Invalid argument"
[11:23:58] [status] Stored 1 note(s) to disk

Actually the same messages kept appearing (about every ten seconds); I guess QON was trying several times to save the note.

The messages stopped when I removed the question mark. Then I got just the one message:

[11:26:48] [status] Stored 1 note(s) to disk

Oh well. I can deal with not using '?' or '/' or double quotes or angle brackets in note names.

I suppose QON could URL-encode note names, but it's nice having notes with readable filenames, and just URL-encoding the name turns every space into '%20'.

QON could just put up a message telling the user that there was a problem saving the note, and if the note name contains one or more characters on a "blacklist" (such as question marks or angle brackets), suggest renaming the note. (If the underlying filesystem accepts question marks or other blacklisted characters in filenames, there'd be no error and no need for the message.)

@pbek

This comment has been minimized.

Owner

pbek commented Jan 21, 2017

The thing is that under Linux with e.g. ext4 every character works perfectly...

@Karig-zz

This comment has been minimized.

Karig-zz commented Jan 21, 2017

I decided that's the solution for me. I reformatted my FAT32 partition as ext4, and question marks and double quotes no longer give me trouble. ;) Thanks.

@pbek

This comment has been minimized.

Owner

pbek commented Jan 22, 2017

17.01.8

  • improved log and status messages when a note could not be saved for example
    when the file system doesn't allow certain characters in the filename

There now is a new release, could you please test it and report if the new features work for you in case you still have a fat32 partition?

@pbek pbek added this to the 17.01.8 milestone Jan 22, 2017

@pbek pbek closed this Jan 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment