omnivore-app / logseq-omnivore

Logseq plugin to fetch articles and highlights from Omnivore
MIT License
284 stars 15 forks source link

Failed to setup sync on logseq #3

Closed jarodise closed 2 years ago

jarodise commented 2 years ago

I obtained the api auth key from the developer tool, then in the settings I input the log in info as 👍🏼 { "username": "jarodise", "api key": "thelongstringkeyIgotfromdevelopertoo" }

However, it didn't work.

I kept on getting an error message as below:

CleanShot 2022-06-21 at 17 27 15@2x

How should I set it properly so the sync would work? Thanks!

pararang commented 2 years ago

I also experienced this issue on v0.7.3. and after upgrading to the latest (0.7.5), the issue was solved and replaced with this new one #4 :(

wingy3181 commented 2 years ago

I get the same issue as this and not the one you mentioned @pararang

I did debug it and can see that this plugin is making a query via graphql POST to the omnivore graphql API

I noticed in the logseq developer tools that it is missing the auth request header

image

also noticed that this plugin has a dependency to the logseq/libs at version 0.0.6 ( See https://github.com/omnivore-app/logseq-omnivore/blob/main/package.json#L26)

versus the 0.0.7 that i believe was released recently... (See https://github.com/logseq/logseq/blob/master/libs/package.json#L3)

Following the logic i can assume the issue is trying to get the settings from the logseq API on these few lines here https://github.com/omnivore-app/logseq-omnivore/blob/main/index.ts#L262

Maybe if someone who has the development environment setup could try update the library to see if it fixes the issue

wingy3181 commented 2 years ago

my bad...they havent published 0.0.7 yet https://www.npmjs.com/package/@logseq/libs

wingy3181 commented 2 years ago

Thanks @sywhb I think you released something recently and now its fixed? I just uninstalled and reinstalled the plugin in logseq and can see a more friendlty settings UI

image
sywhb commented 2 years ago

I obtained the api auth key from the developer tool, then in the settings I input the log in info as 👍🏼 { "username": "jarodise", "api key": "thelongstringkeyIgotfromdevelopertoo" }

However, it didn't work.

I kept on getting an error message as below:

CleanShot 2022-06-21 at 17 27 15@2x

How should I set it properly so the sync would work? Thanks!

Sorry for the inconvenience caused. I have released a new version (v1.4.0) to address this issue.

Could you please kindly update the plugin and try again?

sywhb commented 2 years ago

Thanks @sywhb I think you released something recently and now its fixed? I just uninstalled and reinstalled the plugin in logseq and can see a more friendlty settings UI image

Yeah, I just released a new version (v1.4.0) to address this issue and make some improvement on the UI.

May I know if it works now?

wingy3181 commented 2 years ago

yep all good for me

wingy3181 commented 2 years ago

@sywhb just a separate question which i can raise as a separate issue if you want..

Can you confirm how this plugin deals with logseq or omnivore updates? For example, if I sync logseq and omnivore, then subsequently

From my understanding of the code, you search with save:lastSyncedTimeAt and always insert new blocks so in theory it should always just create a duplicate block for that article (which is probably the better way of dealing with this since it would be very hard to deal with conflicts in data)

I was playing around with it but didn't seem to work but i believe it is an issue on the omnivore API search/query side..... as even within the web app it cannot seem to query properly with some of the advanced queries like is:read

I can give more details but wanted to first confirm the expectation for how this plugin was supposed to work with data updates...

Apologies if I should have created this issue in another repo or another issue.

Thanks

EDIT: I just realised omnivore has a discord channel so i will ask there instead..

sywhb commented 2 years ago

Hey @wingy3181 , I have just released v1.4.3 to resolve this issue.

So now, the latest change of an article will be inserted in Omnivore page too and the old one will be removed.

Please let me know if it works for you!

sywhb commented 2 years ago

Duplicate: #5 #10

wingy3181 commented 2 years ago

@sywhb it works now but i noticed the order of the highlights is in descending order of last creation I think that's existing from my quick look at the code... my preference would be to have the highlights in the order of the article.......which i hope is the just the order that comes back in the array of highlights? will have a look later UPDATE: thinking about it and looking at the API...i'm not 100% sure there is a way to do this...since you cant guarantee the order based on any date.....

also i noticed the annotation could be added to the highlight and maybe a create nested block under the highlight for the annotation? is this something you want to do or you think will impact the performance

sywhb commented 2 years ago

@wingy3181 Thank you for letting me know.

Yeah having the highlights in the order of the article would be more natural and useful. There is a location index in the response allows us to do it.

I don't think adding annotation as a nested block would impact the performance. It's just I haven't figured out a better way to present the highlights. We are planning to reformat the highlight section in this PR: https://github.com/omnivore-app/omnivore/issues/868

sywhb commented 2 years ago

Duplicate here: https://github.com/sywhb/logseq-omnivore/issues/1

sywhb commented 2 years ago

Also adding a deep link to the highlight here: https://github.com/omnivore-app/omnivore/issues/869