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

Wrong behavior of the search function when filtering by TAGs if there are notes with the same name. #1686

Closed
chrixxxx opened this issue Apr 12, 2020 · 17 comments
Labels
Milestone

Comments

@chrixxxx
Copy link

If you have the "use sub-folders" option enabled and you have 2 or more notes with the same name (in different sub-folders, obviously) the search function though a specific tag lists EVERY note with the same name even if it's not tagged with that tag (or not tagged at all).

I'll try to describe this issue with a simple example: I have 3 sub-folders (Alpha, Beta, Gamma) into my base note folder; each sub-folder contains a note with the same name (test.md).

If I assign the tag "TestTag" to only one of this three different test.md notes - and only to one - the tag filter search function with "TestTag" selected lists as result all the three files (with the same name) as they've been tagged with the "TestTag" but two of them are not.

@pbek
Copy link
Owner

pbek commented Apr 12, 2020

Thank you for reporting, I will try to reproduce your issue.

@pbek
Copy link
Owner

pbek commented Apr 12, 2020

If you want to provide a complete note folder to reproduce what you did that would help a lot.

@chrixxxx
Copy link
Author

chrixxxx commented Apr 12, 2020

If you want to provide a complete note folder to reproduce what you did that would help a lot.

Ok. I added explanations in every note, to help you understand the behavior.
With all notes selected try to filter them by tags.
As you will see tags applied to notes with unique names (alpha,beta,gamma) work as they should, while trying to filter using the "test tag" applied ONLY to the "Test.md" note (It's not an unique name, every sub-folder contains a note with this exact name) in the Alpha sub-folder lists all three "Test.md" in the results, even if two of them are not tagged at all.

chrix_testdir.zip

@pbek
Copy link
Owner

pbek commented Apr 12, 2020

Thank you.

And can you please post the output from the debug settings (see issue template).
And is there any useful log output if you enable the log panel (see Window / Panels)? Please make sure you also enable debug logging.

@chrixxxx
Copy link
Author

I hope this is what you were asking.

QOwnNotes Debug Information

General Info

Current Date: dom apr 12 20:56:19 2020
Version: 20.4.5
Build date: Apr 12 2020
Build number: 5535
Platform: windows
Operating System: Windows 7 SP 1 (6.1)
Build architecture: i386
Current architecture: x86_64
Release: AppVeyor
Qt Version (build): 5.13.2
Qt Version (runtime): 5.13.2
Portable mode: yes
Settings path / key: K:/QOwnNotes [portable]/Data/PBE/QOwnNotes.ini
Application database path: K:\QOwnNotes [portable]\Data\QOwnNotes.sqlite
Application arguments: QOwnNotes.exe, --portable
Qt Debug: 0
Locale (system): it_IT
Locale (interface): en
Primary screen resolution: 1440x900
Icon theme: breeze-qownnotes
Notes in current note folder: 6
Calendar items: 0
Enabled scripts: 0

Server Info

serverUrl: empty
appIsValid: no
notesPathExists: empty
connectionErrorMessage: empty

Spellchecking

Enabled: false
Selected language: empty
Language codes: empty
Language names: empty
Application dictionaries path: K:\QOwnNotes [portable]\Data\dicts

Note folders

currentNoteFolderId: 2

Note folder default

id: 1
isCurrent: no
activeTagId: 0
localPath: K:\QOwnNotes [portable]\Data\[Chrix] Notes
remotePath: Notes
cloudConnectionId: 1
isShowSubfolders: no
isUseGit: no
activeNoteSubFolder name: empty
database file: K:\QOwnNotes [portable]\Data\[Chrix] Notes\notes.sqlite

Note folder tempfortests

id: 2
isCurrent: yes
activeTagId: 1
localPath: K:\QOwnNotes [portable]\Data\..\..\[Documenti]\[QOwnNotes] testdir
remotePath: Notes
cloudConnectionId: 1
isShowSubfolders: yes
isUseGit: no
activeNoteSubFolder name: empty
database file: K:\QOwnNotes [portable]\Data\..\..\[Documenti]\[QOwnNotes] testdir\notes.sqlite

Cloud connections

Cloud connection Predefinito

id: 1
isCurrent: yes
serverUrl: empty
username: empty

Enabled scripts

Settings

ActiveNoteHistoryItem (NoteHistoryItem): <binary data>
Debug/fakeOldVersionNumber (QString): false
Debug/fileLogging (QString): false
Editor/CurrentSchemaKey (QString): EditorColorSchema-6033d61b-cb96-46d5-a3a8-20d5172017eb
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/useTabIndent (QString): false
Editor/vimMode (QString): false
IssueAssistantDialog/geometry (QByteArray): <binary data>
LastUpdateCheck (QDateTime): 2020-04-12T20:27:34.362
LinkDialog/geometry (QByteArray): <binary data>
MainWindow/geometry (QByteArray): <binary data>
MainWindow/mainToolBar.iconSize (QString): 24
MainWindow/menuBarGeometry (QByteArray): <binary data>
MainWindow/noteTextEdit.code.font (QString): Courier New,10,-1,2,50,0,0,0,0,0
MainWindow/noteTextEdit.font (QString): MS Shell Dlg 2,11,-1,5,50,0,0,0,0,0,Normale
MainWindow/noteTextView.code.font (QString): Courier New,9,-1,2,50,0,0,0,0,0
MainWindow/noteTextView.font (QString): MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
MainWindow/noteTextView.ignoreCodeFontSize (QString): true
MainWindow/noteTextView.rtl (QString): false
MainWindow/noteTextView.underline (QString): true
MainWindow/noteTextView.useEditorStyles (QString): true
MainWindow/noteTextView.useInternalExportStyling (QString): true
MainWindow/showNotesFromAllNoteSubFolders (bool): true
NoteHistory-1 (QVariantList): <variant list with 1 item(s)>
NoteHistory-2 (QVariantList): <variant list with 6 item(s)>
NoteHistoryCurrentIndex-1 (QString): 0
NoteHistoryCurrentIndex-2 (QString): 5
PiwikClientId (QString): <hidden>
SearchEngineId (QString): 2
SettingsDialog/geometry (QByteArray): <binary data>
SettingsDialog/mainSplitterState (QByteArray): <binary data>
ShowSystemTray (QString): false
StartHidden (QString): false
WelcomeDialog/geometry (QByteArray): <binary data>
acceptAllExternalModifications (QString): false
allowNoteEditing (bool): true
allowOnlyOneAppInstance (QString): true
appMetrics/disableAppHeartbeat (QString): false
appMetrics/disableTracking (QString): false
appMetrics/notificationShown (QString): true
automaticNoteFolderDatabaseClosing (QString): false
checkSpelling (bool): false
closeTodoListAfterSave (QString): false
cryptoKey (QString): <hidden>
currentNoteFolderId (QString): 2
currentWorkspace (QString): initial
cursorWidth (QString): 1
customNoteFileExtensionList: empty
darkMode (QString): false
darkModeColors (QString): false
darkModeIconTheme (QString): false
darkModeTrayIcon (QString): false
defaultNoteFileExtension (QString): md
demoNotesCreated (QString): true
disableAutomaticUpdateDialog (QString): false
disableSavedSearchesAutoCompletion (QString): false
dockWasInitializedOnce (QString): true
enableNoteTree (QString): false
enableSocketServer (QString): true
externalEditorPath (QString): empty
fullyHighlightedBlockquotes (QString): false
gitCommitInterval (QString): 30
gitExecutablePath (QString): empty
gitLogCommand (QString): empty
guiFirstRunInit (bool): true
ignoreAllExternalModifications (QString): false
ignoreAllExternalNoteFolderChanges (QString): false
ignoreNoteSubFolders (QString): ^\.
imageScaleDown (QString): false
imageScaleDownMaximumHeight (QString): 1024
imageScaleDownMaximumWidth (QString): 1024
initialLayoutIdentifier (QString): minimal
insertTimeFormat (QString): empty
interfaceFontSize (QString): 11
interfaceLanguage (QString): en
internalIconTheme (QString): false
itemHeight (QString): 15
legacyLinking (QString): false
localTrash/autoCleanupDays (QString): 30
localTrash/autoCleanupEnabled (QString): true
localTrash/supportEnabled (QString): true
markdownHighlightingEnabled (QString): true
navigationPanelHideSearch (QString): false
networking/ignoreSSLErrors (QString): true
networking/proxyType (QString): 2
newNoteAskHeadline (QString): false
noteEditIsCentralWidget (QString): true
noteListPreview (QString): false
noteSaveIntervalTime (QString): 10
noteSubfoldersPanelDisplayAsFullTree (QString): true
noteSubfoldersPanelHideSearch (QString): false
noteSubfoldersPanelOrder (QString): 0
noteSubfoldersPanelShowFullPath (QString): false
noteSubfoldersPanelShowNotesRecursively (QString): false
noteSubfoldersPanelShowRootFolderName (QString): true
noteSubfoldersPanelSort (QString): 0
notesPanelOrder (QString): 0
notesPanelSort (QString): 1
notesPath (QString): ../../[Documenti]/[QOwnNotes] testdir
notifyAllExternalModifications (QString): false
overrideInterfaceFontSize (QString): false
ownCloud/supportEnabled (QString): false
ownCloud/todoCalendarBackend (QString): 3
ownCloud/todoCalendarCalDAVPassword (QString): <hidden>
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 (QString): K:/QOwnNotes [portable]/Data/[Chrix] Notes
restoreCursorPosition (QString): true
restoreLastNoteAtStartup (QString): true
showMatches (QString): true
showMenuBar (bool): true
showStatusBar (bool): true
systemIconTheme (QString): false
tagWasAddedToNote (QString): true
taggingShowNotesRecursively (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, , actionOpen_List
toolbar/1/name (QString): mainToolBar
toolbar/1/title (QString): Barra degli strumenti principale
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): barra degli strumenti formattazione
toolbar/3/items (QStringList): actionInsert_Link_to_note, actionInsert_image, actionInsert_current_time
toolbar/3/name (QString): insertingToolbar
toolbar/3/title (QString): barra degli strumenti "inserisci"
toolbar/4/items (QStringList): action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note
toolbar/4/name (QString): encryptionToolbar
toolbar/4/title (QString): barra degli strumenti di crittografia
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): barra degli strumenti della finestra
toolbar/6/items (QString): action_Quit
toolbar/6/name (QString): quitToolbar
toolbar/6/title (QString): esci dalla barra degli strumenti
toolbar/size (QString): 6
useNoteFolderButtons (QString): false
useUNIXNewline (QString): false
webSocketServerService/bookmarksNoteName (QString): Bookmarks
webSocketServerService/bookmarksTag (QString): bookmarks
webSocketServerService/port (QString): 22222
workspace-initial/name (QString): Minimale
workspace-initial/noteSubFolderDockWidgetVisible (QString): true
workspace-initial/windowState (QByteArray): <binary data>
workspaces (QString): initial

System environment

ALLUSERSPROFILE: C:\ProgramData
AMDAPPSDKROOT: C:\Program Files (x86)\AMD APP\
APPDATA: C:\Users\Chrix\AppData\Roaming
CommonProgramFiles: C:\Program Files (x86)\Common Files
CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
CommonProgramW6432: C:\Program Files\Common Files
COMPUTERNAME: CHRIS-PC
ComSpec: C:\Windows\system32\cmd.exe
devmgr_show_nonpresent_devices: 1
FP_NO_HOST_CHECK: NO
HOMEDRIVE: C:
HOMEPATH: \Users\Chrix
LOCALAPPDATA: C:\Users\Chrix\AppData\Local
LOGONSERVER: \\CHRIS-PC
NUMBER_OF_PROCESSORS: 2
OS: Windows_NT
Path: C:\Program Files (x86)\Common Files\SIL;D:\Programmi\FieldWorks 8\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE: x86
PROCESSOR_ARCHITEW6432: AMD64
PROCESSOR_IDENTIFIER: AMD64 Family 16 Model 4 Stepping 2, AuthenticAMD
PROCESSOR_LEVEL: 16
PROCESSOR_REVISION: 0402
ProgramData: C:\ProgramData
ProgramFiles: C:\Program Files (x86)
ProgramFiles(x86): C:\Program Files (x86)
ProgramW6432: C:\Program Files
PROMPT: $P$G
PSModulePath: C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC: C:\Users\Public
SystemDrive: C:
SystemRoot: C:\Windows
TEMP: C:\Users\Chrix\AppData\Local\Temp
TMP: C:\Users\Chrix\AppData\Local\Temp
USERDOMAIN: chris-PC
USERNAME: Chrix
USERPROFILE: C:\Users\Chrix
windir: C:\Windows
windows_tracing_flags: 3
windows_tracing_logfile: C:\BVTBin\Tests\installpackage\csilogfile.log
QML_DISABLE_DISK_CACHE: true

@pbek
Copy link
Owner

pbek commented Apr 13, 2020

Yes, thank you, plus this: 😁

And is there any useful log output if you enable the log panel (see Window / Panels)? Please make sure you also enable debug logging.

@chrixxxx
Copy link
Author

chrixxxx commented Apr 13, 2020

Yes, thank you, plus this:

And is there any useful log output if you enable the log panel (see Window / Panels)? Please make sure you also enable debug logging.

I didn't post the log before 'cause I didn't find anything useful in it.
When I select the "test tag" tag to filter out results.. the log shows the same message that it shows when I choose the other tags (alpha, beta, gamma).. but the results it gives are wrong because, as I tried to explain, only the "Test.md" in the alpha sub-folder has been tagged with the "test tag"; but when I select this tag in the tag list.. all three "Test.md" notes are listed, included the two that are not tagged at all (the ones inside beta and gamma subfolders).

Anyway.. here's my log:

[apr 13 07:12:12] [warning]: "Removed log file: " "K:/QOwnNotes [portable]/Data/QOwnNotes.log"
[apr 13 07:12:14] [debug]: Set proxy configuration to use NO proxy
[apr 13 07:12:16] [debug]: initShortcuts - 'menuBarIsVisible': true
[apr 13 07:12:16] [debug]: fileUrlInCurrentNoteFolderToRelativePath - 'path': "K:/[Documenti]/[QOwnNotes] testdir/Gamma/Gamma.md"
[apr 13 07:12:16] [debug]: fileUrlInCurrentNoteFolderToRelativePath - 'canonicalFilePath': "K:/[Documenti]/[QOwnNotes] testdir/Gamma/Gamma.md"
[apr 13 07:12:17] [debug]: cloudConnection: CloudConnection: 1 "Predefinito" "" "" 1
[apr 13 07:12:17] [debug]: buildNotesIndex - 'noteSubFolderId': 0
[apr 13 07:12:17] [debug]: setupNoteFolderTables - 'database version': 14
[apr 13 07:12:17] [debug]: cloudConnection: CloudConnection: 1 "Predefinito" "" "" 1
[apr 13 07:12:17] [debug]: loadNoteDirectoryList
[apr 13 07:12:17] [debug]: reloadTagTree
[apr 13 07:12:17] [debug]: reloadTagTree - 'noteSubFolderIds': QVector()
[apr 13 07:12:17] [debug]: reloadNoteSubFolderTree
[apr 13 07:12:17] [debug]: reloadNoteSubFolderTree
[apr 13 07:12:17] [debug]: reloadTagTree
[apr 13 07:12:17] [debug]: reloadTagTree - 'noteSubFolderIds': QVector(0)
[apr 13 07:12:17] [debug]: loadNoteDirectoryList
[apr 13 07:12:17] [debug]: reloadTagTree
[apr 13 07:12:17] [debug]: reloadTagTree - 'noteSubFolderIds': QVector(0)
[apr 13 07:12:17] [debug]: reloadNoteSubFolderTree
[apr 13 07:12:17] [debug]: reloadTagTree
[apr 13 07:12:17] [debug]: reloadTagTree - 'noteSubFolderIds': QVector()
[apr 13 07:12:27] [debug]: filterNotesByTag - 'tags': (Tag: 3 "Alpha Tag" 0 )
[apr 13 07:12:27] [debug]: filterNotesByTag - 'fileNameList': ("Alpha")
[apr 13 07:12:33] [debug]: filterNotesByTag - 'tags': (Tag: 3 "Alpha Tag" 0 )
[apr 13 07:12:33] [debug]: filterNotesByTag - 'fileNameList': ("Alpha")
[apr 13 07:12:34] [debug]: filterNotesByTag - 'tags': (Tag: 4 "Beta Tag" 0 )
[apr 13 07:12:34] [debug]: filterNotesByTag - 'fileNameList': ("Beta")
[apr 13 07:12:35] [debug]: filterNotesByTag - 'tags': (Tag: 2 "Gamma Tag" 0 )
[apr 13 07:12:35] [debug]: filterNotesByTag - 'fileNameList': ("Gamma")
[apr 13 07:12:36] [debug]: filterNotesByTag - 'tags': (Tag: 1 "Test Tag" 0 )
[apr 13 07:12:36] [debug]: filterNotesByTag - 'fileNameList': ("Test")
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: updatePanelMenu - 'updatePanelMenu'
[apr 13 07:12:42] [debug]: storeSettings - 'noteHistoryItem': NoteHistoryItem: "Beta" "Beta" 128 0

@pbek
Copy link
Owner

pbek commented Apr 13, 2020

Thank you. So we are talking about this:

image

After clicking 1) and 2) then you see 3). Right?

@pbek
Copy link
Owner

pbek commented Apr 13, 2020

@Waqar144, this looks like a regression from #327.

@pbek
Copy link
Owner

pbek commented Apr 13, 2020

I'm not sure if it's a regression or simply never worked. Tag filtering is currently only checking file names in MainWindow::filterNotesByTag.

@pbek
Copy link
Owner

pbek commented Apr 13, 2020

Will be hard to implement (because of the way we need to store the tagging data), I'm taking a look at it.

@pbek pbek added Type: Feature adds functionality and removed Type: Bug - Regression labels Apr 13, 2020
@chrixxxx
Copy link
Author

chrixxxx commented Apr 13, 2020

After clicking 1) and 2) then you see 3). Right?

Yes.. that's exactly the wrong behavior I noticed.

Instead it should only list one note as result, the "Test.md" in the Alpha sub-folder, the only one that has been tagged with the "test tag". 👍

@chrixxxx
Copy link
Author

chrixxxx commented Apr 13, 2020

I'm not sure if it's a regression or simply never worked. Tag filtering is currently only checking file names in MainWindow::filterNotesByTag.

Maybe this is it's the first time someone is using tags so consistently and intensively.

I need them. I usually keep TONS of notes and tags are mandatory if you need a fast and efficient way to sort things out.

pbek added a commit that referenced this issue Apr 13, 2020
@pbek
Copy link
Owner

pbek commented Apr 13, 2020

My brain has knots now. 😅

20.4.6

  • notes are now correctly filtered by tag even if notes with the same name are
    in different note sub-folders

@pbek pbek added this to the 20.4.6 milestone Apr 13, 2020
@pbek
Copy link
Owner

pbek commented Apr 13, 2020

There now is a new release, could you please test it and report if it works for you?

@chrixxxx
Copy link
Author

There now is a new release, could you please test it and report if it works for you?

You're amazing!!!

Tested right now.. and it seems that everything is working as it should!!!!!
No more "bad results" are listed when using tags, even if notes (in different folders) have the same name!

Thank you again!!! 👍

@pbek
Copy link
Owner

pbek commented Apr 13, 2020

Great, thank you for testing! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants