obsidian-tasks-group / obsidian-tasks

Task management for the Obsidian knowledge base.
https://publish.obsidian.md/tasks/
MIT License
2.49k stars 231 forks source link

Tasks indexing attachments (images) #2464

Closed Smitty010 closed 11 months ago

Smitty010 commented 11 months ago

Please check that this issue hasn't been reported before.

Expected Behavior

task plugin should not try to index non-md files. The directory "SecondBrain/attachments" is in my "Excluded File" section of the "Files & Links" settings

Current behaviour

I see this in my developer tools console.

plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.056][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-06x3joV2iZI_PICTh.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.105][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-07v-SzBePEu6ej0v3.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.149][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-08lmnduoy_8Xx1y8V.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.193][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0ahKk_CyyPLTP7I4d.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.236][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0bNcYa_CGzy2l0hx9.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.279][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0dBevDWIhIyzqX3zB.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.323][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0EHbVawAe_BdNL-Rl.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.367][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0g37kzAnZQ-Bxb5vy.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.411][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0JswxjhhGa-XHVYW6.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.462][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0KQq8MY3PXabnLKlh.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.507][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0LjRxdYn6Lg2XPZwg.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.557][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0o-FYQh-Tizo9yGLP.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.616][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0Qb38tTQCWjVRxJnY.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.668][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0T1bMWvFa7zR9SHmM.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.717][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0wE7uJ395ymDA55YL.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.764][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0XS1PgfXclri9eV74.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.833][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-0yAyZyLjOoTJNqF3K.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.885][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-11XQ_a1IVaXc_hxJ-B-3r9w.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.940][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-1ezM5QGtspVfWULna393cbQ.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:34.988][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-1HlYOILcNAlT4xJN_ihFB3w.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.038][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-1lVd7r5ezx2FgaGnRhz-4mA.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.088][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-1jVhq8h1u_3W4VYiKDA0edw.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.133][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-1xWvCCUSmXo3Wf94NWwgz2A.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.175][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/brilliant-evolution-of-transformer-blocks-—-a-mathematical-deep-dive-1y82nlqFY2Y31BUpReV_OUQ.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.225][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/q-algorithm-is-not-q-learning---autonomous-agents---medium-02JnO1nHlBKjqbf88.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.269][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/q-algorithm-is-not-q-learning---autonomous-agents---medium-0dHaVPf8GOcQTBlBa.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.317][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/q-algorithm-is-not-q-learning---autonomous-agents---medium-0Gc7pAz-ONH59w05D.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.361][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/q-algorithm-is-not-q-learning---autonomous-agents---medium-0hRNMkD5aL0Lo-2me.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.407][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/q-algorithm-is-not-q-learning---autonomous-agents---medium-0l3LEw5Lba2Qf6abj.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.453][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/q-algorithm-is-not-q-learning---autonomous-agents---medium-0lMY-XralYw6q5v4f.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.711][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/q-algorithm-is-not-q-learning---autonomous-agents---medium-0nnZusnpoiqX-eWGF.png 
eval @ plugin:obsidian-tasks-plugin:149
plugin:obsidian-tasks-plugin:149 [2023-12-01-14:05:35.753][warn][tasks.Cache] indexFile: WARNING: indexing non-markdown file: SecondBrain/Attachments/2023/202312/q-algorithm-is-not-q-learning---autonomous-agents---medium-0mNQuvNAjoKgbYlJM.png 
eval @ plugin:obsidian-tasks-plugin:149

Steps to reproduce

I believe all I did was copy a couple of articles with local links to images into obsidian (generated with markdownload). The images were copied to the attachments folder. I then restarted Obsidian

Which Operating Systems are you using?

Obsidian Version

1.5.1

Tasks Plugin Version

5.2.0

Checks

Possible solution

No response

claremacrae commented 11 months ago

Thanks for logging the issue.

I put that warning in because I thought I had seen that function be called with non-markdown files, and then was not able to reproduce it.

I then restarted Obsidian

And I cannot reproduce this, with the description provided.

When I pasted an image in to the vault, I did see the message, but not at re-start.

Is it possible the warnings were generated when you pasted the warnings in, and not when you restarted Obsidian?

Smitty010 commented 11 months ago

Yes, it's possible. This clearly isn't a big deal. I'm just seeing severe performance problems with my obsidian vault and so I'm chasing a bunch of stuff. I don't really think the performance problem is a task issue.

On Fri, Dec 1, 2023 at 3:17 PM Clare Macrae @.***> wrote:

Thanks for logging the issue.

I put that warning in because I thought I had seen that function be called with non-markdown files, and then was not able to reproduce it.

I then restarted Obsidian

And I cannot reproduce this, with the description provided.

When I pasted an image in to the vault, I did see the message, but not at re-start.

Is it possible the warnings were generated when you pasted the warnings in, and not when you restarted Obsidian?

— Reply to this email directly, view it on GitHub https://github.com/obsidian-tasks-group/obsidian-tasks/issues/2464#issuecomment-1836853378, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4V7SZF24F2GTT24I3USNDYHJJN7AVCNFSM6AAAAABADN33WCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZWHA2TGMZXHA . You are receiving this because you authored the thread.Message ID: @.***>

claremacrae commented 11 months ago

Is it possible the warnings were generated when you pasted the warnings in, and not when you restarted Obsidian?

I'm pretty sure the answer is yes.

When Tasks loads, indexFile() is called like this:

https://github.com/obsidian-tasks-group/obsidian-tasks/blob/a41262a1b5d91b0e7485e32c1b7669111676076e/src/Cache.ts#L199-L203

It asks for all the Markdown files in the vault, and then calls indexFile() on each one.

However, in the following locations, it calls indexFile() without first checking if the file is a markdown file:

https://github.com/obsidian-tasks-group/obsidian-tasks/blob/a41262a1b5d91b0e7485e32c1b7669111676076e/src/Cache.ts#L131-L135

https://github.com/obsidian-tasks-group/obsidian-tasks/blob/a41262a1b5d91b0e7485e32c1b7669111676076e/src/Cache.ts#L143-L152

There are several consequences of this:

claremacrae commented 11 months ago

Thank you again for logging this.

It enabled me to track down something that had niggled for a while, but I had not known how to reproduce. The pasting in of an image was the key starting point to realising what was going on.

Smitty010 commented 11 months ago

Cheers

On Fri, Dec 1, 2023 at 4:09 PM Clare Macrae @.***> wrote:

Thank you again for logging this.

It enabled me to track down something that had niggled for a while, but I had not known how to reproduce. The pasting in of an image was the key starting point to realising what was going on.

— Reply to this email directly, view it on GitHub https://github.com/obsidian-tasks-group/obsidian-tasks/issues/2464#issuecomment-1836897474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4V7SYNNCXVRUCBWUWRSYTYHJPS7AVCNFSM6AAAAABADN33WCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZWHA4TONBXGQ . You are receiving this because you authored the thread.Message ID: @.***>