AminSallah / Flow.Launcher.Plugin.Notion

Quick capture plugin for search, create, edit, and delete Notion pages.
MIT License
17 stars 0 forks source link

Plugin can't find linked databases #15

Closed Gamemaster-git closed 3 months ago

Gamemaster-git commented 3 months ago

I followed all the steps on the page made a new integration added my database to it added the integration token in the plugin settings but it still says

No database linked with internal integration token

I even tried to delete the cache files manually but it still didn't work. Could you please help me out, thanks.

AminSallah commented 3 months ago

Hey there,

Deleting cache files manually could cause some issues. Please restart Flow Launcher and check if the files database.json and search.json are created successfully in the cache folder. After that, trigger the plugin to query the databases and check if database.json contains your shared databases. If so, open the settings panel and ensure the default database combobox options are not empty.

If database.json is empty and more than one database shared with token, please share your Flow Launcher log file for further investigation.

Gamemaster-git commented 3 months ago

yes it creates the database.json and search.json files but database.json is empty and they both have a file size of 0 KB even though I have shared two databases with my integration.

Here is the latest flow launcher log file.

2024-08-07.txt

AminSallah commented 3 months ago

The Notion API keeps responding with error code 401 (Unauthorized), which means the API token is invalid. Please double-check it or create a new one with all capabilities allowed.

The API token should look something like this:

secret_2XHSvQlNouUkWv5sUqND5VIFOppuA1T7iXd5cfR8gG6

After checking, this error should no longer appear in your log file:

WARN - NotionDataParser.MoveNext - Unauthorized

Or this error if there's an internet connection

WARN  - Main.MoveNext - No internet Connection for Init cache using last cached data
Gamemaster-git commented 3 months ago

I refreshed the integration token, and added the new token into the plugin settings, restarted flow launcher, but got the same error. The log file still has both the warnings you mentioned here it is.

2024-08-07.txt

AminSallah commented 3 months ago

Just to be sure that this issue is not because of your Notion token, could you replace your token with this one, then restart Flow Launcher and see if the plugin still gets the the same error 401 ?

secret_BigY9a1CN22ifHwXNcjCz7soV1jnhiI0fvwOwgHoE2t
Gamemaster-git commented 3 months ago

Alright i replaced it and it still gives the same error here is the log file.

2024-08-07.txt

AminSallah commented 3 months ago

I still can't reproduce this on my side. Let's first check if the token is correctly requested from the settings class.

First, download the v5 artifact and extract the dll file into the home plugin directory, replacing the existing one. Now, when Notion responds with a 401 error, the plugin will log the token. Restart Flow Launcher and then send me the new log file.

Gamemaster-git commented 3 months ago

Hi sorry for the late reply I think our time zones are very different. I replaced it and here is the new log file.

2024-08-08.txt

AminSallah commented 3 months ago

Hey @Gamemaster-git, this update should now handle authentication better. It also logs the full Notion response for better insights. However, I noticed that the token logged in the file is invalid, so I hope you shuffled the characters before sending it and that it's not the actual token you use, as it is invalid. You can still use mine for testing purposes:

secret_BigY9a1CN22ifHwXNcjCz7soV1jnhiI0fvwOwgHoE2t

Let me know if this fixed your issue.

Gamemaster-git commented 3 months ago

Yes, after lots of restarting and finessing of flow launcher it completely works. Thanks a lot for all your help. regarding the invalidity of my token, I refreshed it a few times after sending it, but I did make sure to update it every time in the plugin settings. Again thanks a lot for your help