chhoumann / quickadd

QuickAdd for Obsidian
https://quickadd.obsidian.guide
MIT License
1.5k stars 138 forks source link

Getting Error 401 on iOS and Windows 10 #475

Closed Mike-b07e5 closed 1 year ago

Mike-b07e5 commented 1 year ago

Describe the bug When I attempt to execute an AI macro on iOS or Windows 10, I get an error 401. It DOES work on iPadOS

To Reproduce I followed normal install procedures I set up the defaults I created the Manual Prompt.md file I created a blank file and ran the macro. The macro accepts my input then comes back with an error 401.

Expected behavior I thought it would execute my prompt with GPT. Instead it gave an error 401.

Screenshots not currently available

Desktop (please complete the following information):

Additional context As mentioned, the same setup (same vault) works on iPad. I confirmed exact same setup between iOS and iPad.

chhoumann commented 1 year ago

Hey @Mike-b07e5, thanks for reporting this!

401 means unauthorized. It might be the case that the key wasn't synchronized properly. Could you try updating the setting manually on your computer to force a save update? Adding and removing a space should be fine.

Let me know if this works :)

Mike-b07e5 commented 1 year ago

It does not allow me to update. The key field says sk... and I cannot edit it.

chhoumann commented 1 year ago

Ah, so if it says that, you're seeing the placeholder value, indicating the field is empty.

Are you able to write anything in the field or no?

If yes - try pasting in your API key again. If no - please check the console for any errors. That can be accessed by using the Ctrl + Shift + I shortcut. It should appear on the right side. Errors are in red. Especially those related to QuickAdd are related.

Mike-b07e5 commented 1 year ago

Actually, that was from my Windows machine. I was able to edit the field on iPad. Removed and re-added the last character. The Assistant still works for iPad, and still doesn't work with iOS and Windows.

Mike-b07e5 commented 1 year ago

checking console plugin:quickadd:10483 Uncaught (in promise) Error: Error while making request to OpenAI API: Request failed, status 401 at makeRequest (plugin:quickadd:10483:13)

Mike-b07e5 commented 1 year ago

I was able to edit iOS and it is now working. Rechecking the others...

Mike-b07e5 commented 1 year ago

Well, turns out I can edit the key in iOS and Windows (not sure what my fail was). It is now working on all 3 devices.

chhoumann commented 1 year ago

Hey @Mike-b07e5, thanks for getting back to me on this. Looks like it was some kind of API key sync issue. Glad to hear it's working now.

I think I have an idea what the root cause is, but it's not 100% in QuickAdds control. Will see what I can do, but closing this issue for now.