pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.66k stars 412 forks source link

[BUG?] Adding/removing a new note/subfolder collapses all subfolders. #2844

Closed J0w03L closed 11 months ago

J0w03L commented 1 year ago

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:

qownnotesissue

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:

  1. In the root/note folder, create a new subfolder (eg. "Folder A")
  2. In the root/note folder, create a new subfolder (eg. "Folder B")
  3. In Folder A, create a new subfolder (eg. "Folder A-1")
  4. In Folder B, create a new subfolder (eg. "Folder B-1")
  5. Fully expand all subfolders
  6. Create a new note somewhere. It doesn't matter where; it can even be in the root folder
  7. Notice that doing so collapsed every subfolder

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 `` **id**: `2` **isCurrent**: `no` **activeTagId**: `-1` **localPath**: `/mnt/secure/notes/` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `yes` **isUseGit**: `yes` **allowDifferentNoteFileName**: `yes` **activeNoteSubFolder name**: *empty* **database file**: `/mnt/secure/notes//notes.sqlite` ### Note folder `test` **id**: `3` **isCurrent**: `no` **activeTagId**: `0` **localPath**: `/mnt/secure/notes/test` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `yes` **isUseGit**: `no` **allowDifferentNoteFileName**: `yes` **activeNoteSubFolder name**: `Folder A` **database file**: `/mnt/secure/notes/test/notes.sqlite` ### Note folder `test2` **id**: `4` **isCurrent**: `yes` **activeTagId**: `0` **localPath**: `/mnt/secure/notes/test2` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `yes` **isUseGit**: `no` **allowDifferentNoteFileName**: `no` **activeNoteSubFolder name**: *empty* **database file**: `/mnt/secure/notes/test2/notes.sqlite` ## Cloud connections ### Cloud connection `Default` **id**: `1` **isCurrent**: `yes` **serverUrl**: *empty* **username**: *empty* **accountId**: *empty* ## Enabled scripts ## Settings **ActiveNoteHistoryItem** (NoteHistoryItem): `` **Debug/fakeOldVersionNumber** (QString): `false` **Debug/fileLogging** (QString): `false` **DictionaryManagerDialog/geometry** (QByteArray): `` **DictionaryManagerDialog/mainSplitterState** (QByteArray): `` **DistractionFreeMode/isEnabled** (QString): `false` **DistractionFreeMode/menuBarGeometry** (QByteArray): `` **DistractionFreeMode/menuBarHeight** (QString): `22` **DistractionFreeMode/menuBarVisible** (QString): `true` **DistractionFreeMode/windowState** (QByteArray): `` **Editor/CurrentSchemaKey** (QString): `EditorColorSchema-cdbf28fc-1ddc-4d13-bb21-6a4043316a2f` **Editor/autoBracketClosing** (QString): `true` **Editor/autoBracketRemoval** (QString): `true` **Editor/disableCursorBlinking** (QString): `false` **Editor/editorWidthInDFMOnly** (QString): `true` **Editor/highlightCurrentLine** (QString): `true` **Editor/indentSize** (QString): `4` **Editor/removeTrailingSpaces** (QString): `false` **Editor/showLineNumbers** (QString): `true` **Editor/useTabIndent** (QString): `false` **Editor/vimMode** (QString): `false` **LastUpdateCheck** (QDateTime): `2023-09-15T12:36:36.600` **MainWindow/geometry** (QByteArray): `` **MainWindow/mainToolBar.iconSize** (QString): `24` **MainWindow/menuBarGeometry** (QByteArray): `` **MainWindow/noteSubFolderTreeWidgetExpandState-2**: *empty* **MainWindow/noteTextEdit.code.font** (QString): `monospace,9,-1,2,50,0,0,0,0,0` **MainWindow/noteTextEdit.font** (QString): `Sans Serif,9,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.code.font** (QString): `monospace,9,-1,2,50,0,0,0,0,0` **MainWindow/noteTextView.font** (QString): `Sans Serif,9,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.ignoreCodeFontSize** (QString): `true` **MainWindow/noteTextView.refreshDebounceTime** (QString): `600` **MainWindow/noteTextView.rtl** (QString): `false` **MainWindow/noteTextView.underline** (QString): `true` **MainWindow/noteTextView.useEditorStyles** (QString): `true` **MainWindow/noteTextView.useInternalExportStyling** (QString): `true` **MainWindow/showNotesFromAllNoteSubFolders** (QString): `false` **MessageBoxOverride/linux-light-mode** (QString): `65536` **NoteFolder-1/NoteTabNameList** (QString): `Welcome to QOwnNotes` **NoteFolder-1/NoteTabStickinessList**: *empty* **NoteFolder-1/NoteTabSubFolderPathDataList** (QString): *empty* **NoteFolder-1/allowDifferentNoteFileName** (QString): `false` **NoteFolder-2/NoteTabNameList** (QString): `_Summary` **NoteFolder-2/NoteTabStickinessList**: *empty* **NoteFolder-2/NoteTabSubFolderPathDataList** (QString): ``` ``` **NoteFolder-2/allowDifferentNoteFileName** (QString): `true` **NoteFolder-3/NoteTabNameList** (QString): `Note 2023-09-15T12.28.47` **NoteFolder-3/NoteTabStickinessList**: *empty* **NoteFolder-3/NoteTabSubFolderPathDataList** (QString): *empty* **NoteFolder-3/allowDifferentNoteFileName** (QString): `true` **NoteFolder-4/NoteTabNameList** (QString): `Note 2023-09-15T12.36.08` **NoteFolder-4/NoteTabStickinessList**: *empty* **NoteFolder-4/NoteTabSubFolderPathDataList** (QString): *empty* **NoteFolder-4/allowDifferentNoteFileName** (QString): `false` **NoteHistory-1** (QVariantList): `` **NoteHistory-2** (QVariantList): `` **NoteHistory-3** (QVariantList): `` **NoteHistory-4** (QVariantList): `` **NoteHistoryCurrentIndex-1** (QString): `1` **NoteHistoryCurrentIndex-2** (QString): `31` **NoteHistoryCurrentIndex-3** (QString): `14` **NoteHistoryCurrentIndex-4** (QString): `15` **PiwikClientId** (QString): `` **ScriptRepositoryDialog/geometry** (QByteArray): `` **ScriptRepositoryDialog/mainSplitterState** (QByteArray): `` **SearchEngineId** (QString): `2` **SettingsDialog/geometry** (QByteArray): `` **SettingsDialog/mainSplitterState** (QByteArray): `` **ShowSystemTray** (QString): `false` **StartHidden** (QString): `false` **TagAddDialog/geometry** (QByteArray): `` **WelcomeDialog/geometry** (QByteArray): `` **acceptAllExternalModifications** (QString): `false` **allowNoteEditing** (bool): `true` **allowOnlyOneAppInstance** (QString): `true` **appMetrics/disableAppHeartbeat** (QString): `false` **appMetrics/disableTracking** (QString): `false` **appMetrics/notificationShown** (QString): `true` **autoReadOnlyMode** (QString): `false` **autoReadOnlyModeTimeout** (QString): `30` **automaticNoteFolderDatabaseClosing** (QString): `false` **checkSpelling** (bool): `true` **closeTodoListAfterSave** (QString): `false` **cryptoKey** (QString): `` **currentNoteFolderId** (QString): `4` **currentWorkspace** (QString): `q6Ht79sKmCgV` **cursorWidth** (QString): `1` **darkMode** (QString): `true` **darkModeColors** (QString): `true` **darkModeIconTheme** (QString): `true` **darkModeTrayIcon** (QString): `false` **defaultNoteFileExtension** (QString): `md` **demoNotesCreated** (QString): `true` **disableAutomaticUpdateDialog** (QString): `true` **disableSavedSearchesAutoCompletion** (QString): `false` **dockWasInitializedOnce** (QString): `true` **enableNoteTree** (QString): `true` **enableSocketServer** (QString): `true` **enableWebAppSupport** (QString): `false` **externalEditorPath** (QString): *empty* **fullyHighlightedBlockquotes** (QString): `true` **gitCommitInterval** (QString): `30` **gitExecutablePath** (QString): *empty* **gitLogCommand** (QString): *empty* **guiFirstRunInit** (bool): `true` **ignoreAllExternalModifications** (QString): `false` **ignoreAllExternalNoteFolderChanges** (QString): `false` **ignoreNoteSubFolders** (QString): `^\.` **ignoredNoteFiles** (QString): *empty* **imageScaleDown** (QString): `false` **imageScaleDownMaximumHeight** (QString): `1024` **imageScaleDownMaximumWidth** (QString): `1024` **initialLayoutIdentifier** (QString): `full` **insertTimeFormat** (QString): *empty* **interfaceFontSize** (QString): `11` **interfaceLanguage** (QString): *empty* **internalIconTheme** (QString): `false` **itemHeight** (QString): `17` **legacyLinking** (QString): `false` **localTrash/autoCleanupDays** (QString): `30` **localTrash/autoCleanupEnabled** (QString): `true` **localTrash/supportEnabled** (QString): `true` **markdownHighlightingEnabled** (QString): `true` **navigationPanelAutoSelect** (QString): `true` **navigationPanelHideSearch** (QString): `false` **networking/ignoreSSLErrors** (QString): `true` **networking/proxyType** (QString): `2` **newNoteAskHeadline** (QString): `false` **noteEditIsCentralWidget** (QString): `true` **noteFileExtensionList** (QStringList): `md, txt` **noteListPreview** (QString): `false` **noteSaveIntervalTime** (QString): `10` **noteSubfoldersPanelDisplayAsFullTree** (QString): `true` **noteSubfoldersPanelHideSearch** (QString): `false` **noteSubfoldersPanelOrder** (QString): `0` **noteSubfoldersPanelShowFullPath** (QString): `true` **noteSubfoldersPanelShowNotesRecursively** (QString): `true` **noteSubfoldersPanelShowRootFolderName** (QString): `true` **noteSubfoldersPanelSort** (QString): `0` **notesPanelOrder** (QString): `0` **notesPanelSort** (QString): `1` **notesPath** (QString): `/mnt/secure/notes/test2` **notifyAllExternalModifications** (QString): `false` **overrideInterfaceFontSize** (QString): `false` **ownCloud/supportEnabled** (QString): `false` **ownCloud/todoCalendarBackend** (QString): `3` **ownCloud/todoCalendarCalDAVPassword** (QString): `` **ownCloud/todoCalendarCalDAVServerUrl** (QString): *empty* **ownCloud/todoCalendarCalDAVUsername** (QString): *empty* **ownCloud/todoCalendarCloudConnectionId** (QString): `1` **ownCloud/todoCalendarDisplayNameList**: *empty* **ownCloud/todoCalendarEnabledList**: *empty* **ownCloud/todoCalendarEnabledUrlList**: *empty* **ownCloud/todoCalendarUrlList**: *empty* **ownCloudInfo/appIsValid** (bool): `false` **ownCloudInfo/connectionErrorMessage** (QString): *empty* **ownCloudInfo/notesPathExistsText** (QString): *empty* **ownCloudInfo/serverVersion** (QString): *empty* **recentNoteFolders** (QStringList): `/mnt/secure/notes/test, /mnt/secure/notes/, /mnt/secure/notes` **restoreCursorPosition** (QString): `true` **restoreLastNoteAtStartup** (QString): `true` **restoreNoteTabs** (QString): `true` **savedSearches/noteFolder-2** (QStringList): `` **savedSearches/noteFolder-3** (QStringList): `Note 2023-09-15T12.28.47, Note 2023-09-15T12.28.42, Note 2023-09-15T12.24.54, Note 2023-09-15T12.23.03, Note 2023-09-15T12.17.04, Note 2023-09-15T12.17.01, Note 2023-09-15T10.27.27, Note 2023-09-15T10.22.59, Note 2023-09-15T10.20.17, Note 2023-09-15T10.18.55, Note 2023-09-15T10.18.18, Note 2023-09-15T10.17.53` **savedSearches/noteFolder-4** (QString): `Note 2023-09-15T12.36.08` **showMatches** (QString): `true` **showMenuBar** (bool): `true` **showStatusBar** (bool): `true` **spellCheckLanguage** (QString): `auto` **startInReadOnlyMode** (QString): `false` **systemIconTheme** (QString): `false` **tagWasAddedToNote** (QString): `true` **taggingShowNotesRecursively** (QString): `false` **tagsPanelHideNoteCount** (QString): `false` **tagsPanelHideSearch** (QString): `false` **tagsPanelOrder** (QString): `0` **tagsPanelSort** (QString): `0` **todoCalendarSupport** (QString): `true` **toolbar/1/items** (QStringList): `action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionShow_local_trash, actionAllow_note_editing, , action_Back_in_note_history, action_Forward_in_note_history, , action_Find_text_in_note, actionReplace_in_current_note, , actionShow_versions, actionShow_trash, actionShare_note, , actionShow_Todo_List` **toolbar/1/name** (QString): `mainToolBar` **toolbar/1/title** (QString): `main toolbar` **toolbar/2/items** (QStringList): `actionFormat_text_bold, actionFormat_text_italic, actionStrike_out_text, actionInsert_code_block, actionInsert_block_quote` **toolbar/2/name** (QString): `formattingToolbar` **toolbar/2/title** (QString): `formatting toolbar` **toolbar/3/items** (QStringList): `actionInsert_text_link, actionInsert_image, actionInsert_current_time` **toolbar/3/name** (QString): `insertingToolbar` **toolbar/3/title** (QString): `inserting toolbar` **toolbar/4/items** (QStringList): `action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note` **toolbar/4/name** (QString): `encryptionToolbar` **toolbar/4/title** (QString): `encryption toolbar` **toolbar/5/items** (QStringList): `actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size` **toolbar/5/name** (QString): `windowToolbar` **toolbar/5/title** (QString): `window toolbar` **toolbar/6/items** (QString): `action_Quit` **toolbar/6/name** (QString): `quitToolbar` **toolbar/6/title** (QString): `quit toolbar` **toolbar/size** (QString): `6` **useNoteFolderButtons** (QString): `false` **useUNIXNewline** (QString): `false` **webAppClientService/serverUrl** (QString): `wss://app.qownnotes.org` **webAppClientService/token** (QString): `` **webSocketServerService/bookmarksNoteName** (QString): `Bookmarks` **webSocketServerService/bookmarksTag** (QString): `bookmarks` **webSocketServerService/commandSnippetsNoteName** (QString): `Commands` **webSocketServerService/commandSnippetsTag** (QString): `commands` **webSocketServerService/port** (QString): `22222` **workspace-initial/name** (QString): `Full` **workspace-initial/noteSubFolderDockWidgetVisible** (QString): `true` **workspace-initial/windowState** (QByteArray): `` **workspace-q6Ht79sKmCgV/name** (QString): `Full` **workspace-q6Ht79sKmCgV/noteSubFolderDockWidgetVisible** (QString): `true` **workspace-q6Ht79sKmCgV/windowState** (QByteArray): `` **workspaces** (QStringList): `initial, q6Ht79sKmCgV` ## System environment **SHELL**: `/bin/bash` **CSF_MDTVTexturesDirectory**: `/usr/share/opencascade/resources/Textures` **XDG_SESSION_PATH**: `/org/freedesktop/DisplayManager/Session0` **CSF_DrawPluginDefaults**: `/usr/share/opencascade/resources/DrawResources` **CSF_LANGUAGE**: `us` **CSF_MIGRATION_TYPES**: `/usr/share/opencascade/resources/StdResource/MigrationSheet.txt` **GRADLE_HOME**: `/usr/share/java/gradle` **DESKTOP_SESSION**: `awesome` **CSF_OCCTResourcePath**: `/usr/share/opencascade/resources` **CSF_STEPDefaults**: `/usr/share/opencascade/resources/XSTEPResource` **GTK_MODULES**: `canberra-gtk-module` **XDG_SEAT**: `seat0` **PWD**: `/home/j0w03l` **XDG_SESSION_DESKTOP**: `awesome` **LOGNAME**: `j0w03l` **XDG_SESSION_TYPE**: `x11` **DRAWHOME**: `/usr/share/opencascade/resources/DrawResources` **XAUTHORITY**: `/home/j0w03l/.Xauthority` **CSF_StandardLiteDefaults**: `/usr/share/opencascade/resources/StdResource` **XDG_GREETER_DATA_DIR**: `/var/lib/lightdm-data/j0w03l` **MOTD_SHOWN**: `pam` **HOME**: `/home/j0w03l` **LANG**: `en_GB.UTF-8` **XDG_SEAT_PATH**: `/org/freedesktop/DisplayManager/Seat0` **CSF_ShadersDirectory**: `/usr/share/opencascade/resources/Shaders` **CSF_EXCEPTION_PROMPT**: `1` **CSF_XmlOcafResource**: `/usr/share/opencascade/resources/XmlOcafResource` **CSF_SHMessage**: `/usr/share/opencascade/resources/SHMessage` **XDG_SESSION_CLASS**: `user` **USER**: `j0w03l` **CSF_StandardDefaults**: `/usr/share/opencascade/resources/StdResource` **CSF_IGESDefaults**: `/usr/share/opencascade/resources/XSTEPResource` **DISPLAY**: `:0` **CSF_XCAFDefaults**: `/usr/share/opencascade/resources/StdResource` **SHLVL**: `0` **XDG_VTNR**: `7` **CSF_PluginDefaults**: `/usr/share/opencascade/resources/StdResource` **CSF_TObjMessage**: `/usr/share/opencascade/resources/TObj` **XDG_SESSION_ID**: `2` **PT8HOME**: `/opt/packettracer/` **CASROOT**: `/usr` **XDG_RUNTIME_DIR**: `/run/user/1000` **DEBUGINFOD_URLS**: `https://debuginfod.archlinux.org ` **QT_AUTO_SCREEN_SCALE_FACTOR**: `1` **CSF_XSMessage**: `/usr/share/opencascade/resources/XSMessage` **MMGT_CLEAR**: `1` **XDG_DATA_DIRS**: `/home/j0w03l/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop` **PATH**: `/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/opt/android-sdk/platform-tools:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin` **CSF_TObjDefaults**: `/usr/share/opencascade/resources/StdResource` **GDMSESSION**: `awesome` **DBUS_SESSION_BUS_ADDRESS**: `unix:path=/run/user/1000/bus` **MAIL**: `/var/spool/mail/j0w03l` **DRAWDEFAULT**: `/usr/share/opencascade/resources/DrawResources/DrawDefault`

Relevant log output in the Log panel

Expand
J0w03L commented 1 year 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.

pbek commented 1 year ago

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.

pbek commented 1 year ago

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).

J0w03L commented 1 year ago

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.)

J0w03L commented 1 year ago

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
pbek commented 1 year ago

Can't see anything unusual...

J0w03L commented 1 year ago

Is there any extra info or actions I could try/provide that might help?

pbek commented 1 year ago

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. 😬

J0w03L commented 1 year ago

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.

J0w03L commented 1 year ago

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);
      |                             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
pbek commented 1 year ago

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.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 11 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

J0w03L commented 1 month ago

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.

pbek commented 1 month ago

No, nothing changed. I was not able to reproduce this anyway 😅

J0w03L commented 1 month ago

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.