omnivore-app / obsidian-omnivore

Obsidian plugin to fetch articles and highlights from Omnivore
MIT License
720 stars 39 forks source link

Import fails once content of the article is included #193

Closed herr-schaft closed 3 months ago

herr-schaft commented 4 months ago

Importing articles from Omnivore to Obsidian fails, once I try to include the content of the article. Tried a couple of article templates. All seem to work fine – importing labels, highlights, notes etc. – until I try and add the content of the artice. Neither {{{ content }}} nor {{{content}}} without spacing works.

The plugin will start 'fetching articles' but then seems to give up. No articles are fetched nor is an error displayed. The Obsidian log shows the standard:

2024-02-10 23:09 - Uploading file .obsidian/plugins/obsidian-omnivore/data.json
2024-02-10 23:09 - Upload complete .obsidian/plugins/obsidian-omnivore/data.json
2024-02-10 23:09 - Fully synced

This would be my complete article template – which works fine once stripped of the content:

#omnivore {{#labels}} #{{name}} {{/labels}}

{{#highlights.length}}
## Highlights

{{#highlights}}
> {{{text}}} [⤴️]({{{highlightUrl}}}) {{#labels}} #{{name}} {{/labels}} ^{{{highlightID}}}
{{#note}}

{{{note}}}
{{/note}}

{{/highlights}}
{{/highlights.length}}

{{{ content }}}

[Read on Omnivore]({{{omnivoreUrl}}})
[Read Original]({{{originalUrl}}})

The issue seems related to #185 and #179, which do not explicitly mention the article content, though.

MaryseBucking commented 4 months ago

@herr-schaft: thanks, this is exactly the problem why it isn't syncing properly for me. When deleting the content from my template, it syncs everything. Not what I want however. Also I get an error in my frontmatter, I used an advanced template for this. omnivore_error: There was an error parsing the front matter template. See console for details.

Looking at the non-synced articles, the break seems to have happened on February 1st or 2nd.

bayang commented 4 months ago

@MaryseBucking are you using a custom query to sync ? I was having the same problem as you : no more articles being imported in obsidian and the logs showing no errors at all. Just nothing was imported.

This behaviour started a few weeks ago , and the last answer in this issue fixed it for me : https://github.com/omnivore-app/omnivore/issues/3499

-> tl;dr; -> Hi, if you have a custom query you should add in:all to get archived items so something like in:all label:Obsidian

herr-schaft commented 4 months ago

@bayang, the query in:archive works fine for me (until I try to add the content of an article). Meaning: in:all isn't the only query working.

bayang commented 4 months ago

@herr-schaft There are different issues I think. But on my side, a custom query without the in part is not working anymore.

sywhb commented 4 months ago

hey @bayang @herr-schaft , i just released a new version v1.9.4 to address the custom query issue.

could you please try it out?

bayang commented 4 months ago

@sywhb here are the logs and my observations after upgrading :

09:15:54.355 plugin:obsidian-omnivore:14254 obsidian-omnivore: advanced filter is replaced with all filter
09:15:54.355 plugin:obsidian-omnivore:14257 obsidian-omnivore: custom query is set to in:all (in:all label:omnivore)

I had set my query to in:all label:omnivore and it seems your update sets it to in:all (in:all label:omnivore)

If I understand correctly to work the query has to include the in: query ?

Maybe just put it in bold in the docs and be done with it so that people know it.

I tried to import with just label:omnivore and it didn't work, I set it back to in:all label:omnivore and it worked .

herr-schaft commented 4 months ago

@sywhb sadly no change for me. Synching items continues to work fine until I add the {{{ content }}}of an article to the article template. This is regardless of the custom query being in:all (in:archive) or just in:archive.

sywhb commented 4 months ago

@sywhb here are the logs and my observations after upgrading :

09:15:54.355 plugin:obsidian-omnivore:14254 obsidian-omnivore: advanced filter is replaced with all filter
09:15:54.355 plugin:obsidian-omnivore:14257 obsidian-omnivore: custom query is set to in:all (in:all label:omnivore)

I had set my query to in:all label:omnivore and it seems your update sets it to in:all (in:all label:omnivore)

If I understand correctly to work the query has to include the in: query ?

Maybe just put it in bold in the docs and be done with it so that people know it.

I tried to import with just label:omnivore and it didn't work, I set it back to in:all label:omnivore and it worked .

thanks for the feedback!

if in filter were not set in the custom query, it would use in:inbox by default

sywhb commented 4 months ago

@sywhb sadly no change for me. Synching items continues to work fine until I add the {{{ content }}}of an article to the article template. This is regardless of the custom query being in:all (in:archive) or just in:archive.

that's kind of weird because it would show an error message in the console logs if it failed to sync the content.

i suspect it is still syncing. would you mind opening you .obsidian/plugins/obsidian-omnivore/data.json when it starts to sync data from omnivore? there is a key "syncing" in the json file and if it finished syncing, the value would be false.

PatNei commented 4 months ago

I get the same error, the console reveals the following error:

image
MaryseBucking commented 4 months ago

I updated to the latest version, and it kept saying it was syncing, but nothing happened. I noticed that my 'last sync' was emptied in the settings, so I manually set it to the first of this month. Then tried again. After a while it gave an error and when I tried to sync again by manually starting the sync, it immediately said: failed to fetch articles. I've added the log. obsidian.md-1708763381316.log

Also, I've copied the data.json from the plugins with the settings. Of course I've deleted my API key, but maybe it'll help if you see the settings. data-nokey.json

herr-schaft commented 4 months ago

@sywhb sadly no change for me. Synching items continues to work fine until I add the {{{ content }}}of an article to the article template. This is regardless of the custom query being in:all (in:archive) or just in:archive.

that's kind of weird because it would show an error message in the console logs if it failed to sync the content.

i suspect it is still syncing. would you mind opening you .obsidian/plugins/obsidian-omnivore/data.json when it starts to sync data from omnivore? there is a key "syncing" in the json file and if it finished syncing, the value would be false.

@sywhb, sorry for the late reply. Your are probably right in that it is still syncing. It's just that it doesn't ever seem to stop or produce any result. The syncing key shows 'true'. And no matter how long I wait, the plugin shows a 'already syncing' message when I try to (manually) sync again. From what I read, #202 seems to be on to something.

For good measure, this is my .obsidian/plugins/obsidian-omnivore/data.json dateHighlightedFormat | "yyyy-MM-dd HH:mm:ss" dateSavedFormat | "yyyy-MM-dd HH:mm:ss" apiKey | "mine :)" filter | "ARCHIVED" syncAt | "" customQuery | "in:archive" template | "#omnivore {{#labels}} #{{name}} {{/labels}}\n\n{{#highlights.length}}\n## Highlights\n\n{{#highlights}}\n> {{{text}}} [⤴️]({{{highlightUrl}}}) {{#labels}} #{{name}} {{/labels}} ^{{{highlightID}}}\n{{#note}}\n\n{{{note}}}\n{{/note}}\n\n{{/highlights}}\n{{/highlights.length}}\n\n\n{{{ content }}}\n\n[Read on Omnivore]({{{omnivoreUrl}}})\n[Read Original]({{{originalUrl}}})" highlightOrder | "LOCATION" syncing | true folder | "Omnivore/" folderDateFormat | "yyyy-MM-dd" endpoint | "https://api-prod.omnivore.app/api/graphql" filename | "{{{title}}}" filenameDateFormat | "yyyy-MM-dd" attachmentFolder | "Omnivore/attachments" version | "1.9.4" isSingleFile | false frequency | 0 intervalId | 0 frontMatterVariables | [] frontMatterTemplate | "" syncOnStart | false

github-actions[bot] commented 2 months ago

:tada: This issue has been resolved in version 1.9.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: