Closed J0w03L closed 11 months ago
Will admit I'm a little uncertain if this should be classed as a bug or a feature request, but either way the point I'm making should come across. On one hand I feel like this probably isn't how it's supposed to work due to how cumbersome this behaviour is, but on the other hand this is an experimental feature and this behaviour may be intentional at the current time.
I can't reproduce that on my Linux system (NixOS). For me the subfolders are reloaded but the last one (where I created the new one) stays selected afterward.
Is there any useful log output if you enable the log panel (see Window / Panels)? Please make sure you also enable debug logging in the log panel (by right-clicking on the panel and selecting Debug in Options).
Yes, there is some debugging output:
When creating a new note in the root folder:
[14:28:59] [debug] storing note file: "Note 2023-09-15T14.28.59.md"
[14:28:59] [status] Stored current note to disk
[14:28:59] [debug] loadNoteDirectoryList
[14:28:59] [debug] reloadTagTree
[14:28:59] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 12, 13, 14, 15)
[14:28:59] [debug] setCurrentNote - 'note': Note: <id>1 <name>"Note 2023-09-15T14.28.59" <fileName>"Note 2023-09-15T14.28.59.md" <noteSubFolderId>0 <relativePath>"" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': true
[14:28:59] [debug] added to history: NoteHistoryItem: <noteName>"Note 2023-09-15T14.28.59" <noteSubFolderPathData>"" <cursorPosition>0 <relativeScrollBarPosition>0
Right-click and removing said note:
[14:33:34] [debug] on_noteTreeWidget_itemSelectionChanged
[14:33:34] [debug] setCurrentNote - 'note': Note: <id>1 <name>"Note 2023-09-15T14.30.46" <fileName>"Note 2023-09-15T14.30.46.md" <noteSubFolderId>0 <relativePath>"" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[14:33:34] [debug] added to history: NoteHistoryItem: <noteName>"Note 2023-09-15T14.30.46" <noteSubFolderPathData>"" <cursorPosition>51 <relativeScrollBarPosition>0
[14:33:39] [debug] doTrashing - 'destinationFileName': "/mnt/secure/notes/test2/trash/3"
[14:33:39] [debug] removeNoteFile - 'trashResult': true
[14:33:39] [debug] removeNoteFile - 'this->fileName': "Note 2023-09-15T14.30.46.md"
[14:33:39] [debug] removeNoteFile - 'file': "/mnt/secure/notes/test2/Note 2023-09-15T14.30.46.md"
[14:33:39] [debug] Removed note "Note 2023-09-15T14.30.46"
[14:33:39] [debug] loadNoteDirectoryList
[14:33:39] [debug] reloadTagTree
[14:33:39] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 12, 13, 14, 15)
(Apologies for the previous log revision containing a warning; after further examination this was caused by switching folders and doesn't happen otherwise. Said warning is seen in the full log contained in my next comment.)
Complete logs from following all steps listed in the Steps to reproduce
section:
[14:39:42] [debug] on_noteTreeWidget_itemSelectionChanged
[14:39:42] [debug] setCurrentNote - 'note': Note: <id>0 <name>"" <fileName>"" <noteSubFolderId>0 <relativePath>"" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[14:39:42] [warning] QTextCursor::setPosition: Position '6' out of range
[14:39:45] [debug] buildNotesIndex - 'noteSubFolderId': 0
[14:39:45] [debug] buildNotesIndex - 'files': ()
[14:39:45] [debug] buildNotesIndex - 'files': ()
[14:39:45] [debug] setupNoteFolderTables - 'database version': 15
[14:39:45] [debug] cloudConnection: CloudConnection: <id>1 <name>"Default" <serverUrl>"" <username>"" <accountId>"" <priority>1
[14:39:45] [debug] loadNoteDirectoryList
[14:39:45] [debug] reloadTagTree
[14:39:45] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1)
[14:39:45] [debug] Current sub folder changed
[14:39:45] [debug] reloadTagTree
[14:39:45] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1)
[14:39:46] [debug] on_noteTreeWidget_itemSelectionChanged
[14:39:46] [debug] setCurrentNote - 'note': Note: <id>0 <name>"" <fileName>"" <noteSubFolderId>0 <relativePath>"" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[14:39:46] [warning] QTextCursor::setPosition: Position '6' out of range
[14:39:49] [debug] buildNotesIndex - 'noteSubFolderId': 0
[14:39:49] [debug] buildNotesIndex - 'files': ()
[14:39:49] [debug] buildNotesIndex - 'files': ()
[14:39:49] [debug] buildNotesIndex - 'files': ()
[14:39:49] [debug] setupNoteFolderTables - 'database version': 15
[14:39:49] [debug] cloudConnection: CloudConnection: <id>1 <name>"Default" <serverUrl>"" <username>"" <accountId>"" <priority>1
[14:39:49] [debug] loadNoteDirectoryList
[14:39:49] [debug] reloadTagTree
[14:39:49] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 2)
[14:39:49] [debug] Current sub folder changed
[14:39:49] [debug] reloadTagTree
[14:39:49] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 2)
[14:39:50] [debug] Current sub folder changed
[14:39:50] [debug] reloadTagTree
[14:39:50] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 2)
[14:39:50] [debug] on_noteTreeWidget_itemSelectionChanged
[14:39:50] [debug] setCurrentNote - 'note': Note: <id>0 <name>"" <fileName>"" <noteSubFolderId>0 <relativePath>"" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[14:39:50] [warning] QTextCursor::setPosition: Position '6' out of range
[14:39:53] [debug] buildNotesIndex - 'noteSubFolderId': 0
[14:39:53] [debug] buildNotesIndex - 'files': ()
[14:39:53] [debug] buildNotesIndex - 'files': ()
[14:39:53] [debug] buildNotesIndex - 'files': ()
[14:39:53] [debug] buildNotesIndex - 'files': ()
[14:39:53] [debug] setupNoteFolderTables - 'database version': 15
[14:39:53] [debug] cloudConnection: CloudConnection: <id>1 <name>"Default" <serverUrl>"" <username>"" <accountId>"" <priority>1
[14:39:53] [debug] loadNoteDirectoryList
[14:39:53] [debug] reloadTagTree
[14:39:53] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 3, 2)
[14:39:53] [debug] Current sub folder changed
[14:39:53] [debug] reloadTagTree
[14:39:53] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 3, 2)
[14:39:54] [debug] Current sub folder changed
[14:39:54] [debug] reloadTagTree
[14:39:54] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 3, 2)
[14:39:54] [debug] on_noteTreeWidget_itemSelectionChanged
[14:39:54] [debug] setCurrentNote - 'note': Note: <id>0 <name>"" <fileName>"" <noteSubFolderId>0 <relativePath>"" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[14:39:54] [warning] QTextCursor::setPosition: Position '6' out of range
[14:39:57] [debug] buildNotesIndex - 'noteSubFolderId': 0
[14:39:57] [debug] buildNotesIndex - 'files': ()
[14:39:57] [debug] buildNotesIndex - 'files': ()
[14:39:57] [debug] buildNotesIndex - 'files': ()
[14:39:57] [debug] buildNotesIndex - 'files': ()
[14:39:57] [debug] buildNotesIndex - 'files': ()
[14:39:57] [debug] setupNoteFolderTables - 'database version': 15
[14:39:57] [debug] cloudConnection: CloudConnection: <id>1 <name>"Default" <serverUrl>"" <username>"" <accountId>"" <priority>1
[14:39:57] [debug] loadNoteDirectoryList
[14:39:57] [debug] reloadTagTree
[14:39:57] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 3, 2, 4)
[14:39:57] [debug] Current sub folder changed
[14:39:57] [debug] reloadTagTree
[14:39:57] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 3, 2, 4)
[14:40:00] [debug] on_noteTreeWidget_itemSelectionChanged
[14:40:00] [debug] setCurrentNote - 'note': Note: <id>0 <name>"" <fileName>"" <noteSubFolderId>0 <relativePath>"" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': false
[14:40:00] [warning] QTextCursor::setPosition: Position '6' out of range
[14:40:01] [debug] storing note file: "Note 2023-09-15T14.40.01.md"
[14:40:01] [status] Stored current note to disk
[14:40:01] [debug] loadNoteDirectoryList
[14:40:01] [debug] reloadTagTree
[14:40:01] [debug] reloadTagTree - 'noteSubFolderIds': QVector(0, 1, 3, 2, 4)
[14:40:02] [debug] setCurrentNote - 'note': Note: <id>1 <name>"Note 2023-09-15T14.40.01" <fileName>"Note 2023-09-15T14.40.01.md" <noteSubFolderId>0 <relativePath>"" <hasDirtyData>false - 'updateNoteText': true - 'updateSelectedNote': true
[14:40:02] [debug] added to history: NoteHistoryItem: <noteName>"Note 2023-09-15T14.40.01" <noteSubFolderPathData>"" <cursorPosition>0 <relativeScrollBarPosition>0
Can't see anything unusual...
Is there any extra info or actions I could try/provide that might help?
You could only try to build QOwnNotes yourself and debug. Looks like some kind of race-condition to me. I wasn't able to reproduce it on any of my systems yet. 😬
Built as per the README states (although I had to add -Wno-redundant-move -Wno-dangling-reference
to CXXFLAGS
in src/Makefile
for it to compile successfully), and the issue is still there. I'm not fully sure what to look for in gdb here or anything so if you have any suggestions on where to look or anything feel free to mention them.
Just in case it's of any use, here are the two errors I had to ignore:
entities/note.cpp: In static member function ‘static const QString Note::getNoteURL(const QString&)’:
entities/note.cpp:3136:69: error: redundant move in initialization [-Werror=redundant-move]
3136 | return QStringLiteral("note://") + generateTextForLink(std::move(baseName));
| ~~~~~~~~~^~~~~~~~~~
entities/note.cpp:3136:69: note: remove ‘std::move’ call
libraries/sonnet/src/core/tokenizer.cpp: In member function ‘Sonnet::Token Sonnet::BreakTokenizerPrivate::next()’:
libraries/sonnet/src/core/tokenizer.cpp:148:17: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
148 | const auto &textBreak = this->breaks().at(itemPosition);
| ^~~~~~~~~
libraries/sonnet/src/core/tokenizer.cpp:148:46: note: the temporary was destroyed at the end of the full expression ‘Sonnet::BreakTokenizerPrivate::breaks() const().QVector<Sonnet::TextBreaks::Position>::at(((Sonnet::BreakTokenizerPrivate*)this)->Sonnet::BreakTokenizerPrivate::itemPosition)’
148 | const auto &textBreak = this->breaks().at(itemPosition);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
Built as per the README states (although I had to add -Wno-redundant-move -Wno-dangling-reference to CXXFLAGS in src/Makefile for it to compile successfully)
The Makefile was created by qmake, wasn't it?
If you really want to step-debug it, I'd tend to use QtCreator to build and run the application.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Not sure when exactly the problem was fixed as I didn't update QOwnNotes for a fair while, but I can confirm that this no longer happens on 24.9.3! I would re-mark this as solved.
No, nothing changed. I was not able to reproduce this anyway 😅
Apparently a friend of mine IRL had this on Debian too, but I don't know anything about their environment/version besides that they're on Debian. No idea why it was happening but for me at least it doesn't happen anymore, for whatever reason.
Expected behaviour
When adding/removing new notes/subfolders, the subfolders stay in their current collapsed or expanded state.
Actual behaviour
When adding/removing new notes/subfolders, the subfolders are all collapsed as seen below:
This is quite counter productive, especially when trying to categorize multiple notes at once.
Steps to reproduce
Firstly, ensure that the experimental "note tree" setting is enabled, then perform the following steps on a blank/empty note folder with subfolders enabled:
Output from the debug section in the settings dialog
Expand
QOwnNotes Debug Information =========================== ## General Info **Current Date**: `Fri Sept 15 12:37:01 2023` **Version**: `23.9.3` **Build date**: `Sep 15 2023` **Build number**: `1054` **Platform**: `linux` **Operating System**: `Arch Linux` **Build architecture**: `x86_64` **Current architecture**: `x86_64` **Release**: `AUR` **Qt Version (build)**: `5.15.9` **Qt Version (runtime)**: `5.15.9` **Portable mode**: `no` **Settings path / key**: `/home/j0w03l/.config/PBE/QOwnNotes.conf` **Application database path**: `/home/j0w03l/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite` **Application arguments**: `QOwnNotes` **Qt Debug**: `0` **Locale (system)**: `en_GB` **Locale (interface)**: *empty* **Primary screen resolution**: `1920x1080` **Icon theme**: `breeze-dark-qownnotes` **Notes in current note folder**: `1` **Calendar items**: `0` **Enabled scripts**: `0` ## Server Info **serverUrl**: *empty* **appIsValid**: `no` **notesPathExists**: *empty* **connectionErrorMessage**: *empty* ## Spellchecking **Enabled**: `true` **Selected language**: `auto` **Language codes**: `en_AG, en_BS, en_BW, en_BZ, en_DK, en_GB, en_GB-large, en_GH, en_HK, en_IE, en_IN, en_JM, en_NA, en_NG, en_NZ, en_SG, en_TT, en_ZA, en_ZW` **Language names**: `English (Antigua & Barbuda), English (Bahamas), English (Botswana), English (Belize), English (Denmark), British English (United Kingdom), British English (United Kingdom) [large], English (Ghana), English (Hong Kong SAR China), English (Ireland), English (India), English (Jamaica), English (Namibia), English (Nigeria), English (New Zealand), English (Singapore), English (Trinidad & Tobago), English (South Africa), English (Zimbabwe)` **Application dictionaries path**: `/home/j0w03l/.local/share/PBE/QOwnNotes/dicts` ## Note folders **currentNoteFolderId**: `4` ### Note folder `default` **id**: `1` **isCurrent**: `no` **activeTagId**: `1` **localPath**: `/mnt/secure/notes` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `no` **isUseGit**: `no` **allowDifferentNoteFileName**: `no` **activeNoteSubFolder name**: *empty* **database file**: `/mnt/secure/notes/notes.sqlite` ### Note folder `Relevant log output in the Log panel
Expand