Just another +1 on this issue.
I see - I think :sweat_smile: - that the PR is targeting Craft 3.8? In which case; we have the issue in Craft 3.8.5. I can confirm that when I apply the changes from the PR - I guess specifically commit d6236c0b8127eba941e03160431288fe205f4bb2 - to our local project, the upload works as expected again.
Basically we can reproduce this locally, and can also confirm that for us the PR fixes the issue :sweat_smile:
The previous implementation of the CraftagramService would exit if the first site did not have a configured long access token.
It would also return true
if the API call to Instagram failed.
The console controller returned the raw bool value as well, which mean that true
gets converted to 1
which shells interpret as "exited with an error".
Also fix some typos and unused namespace imports.
I know this breaks the previous behavior but I thought this might be more in line with the intended behavior. I made this PR for Craft 3 branch still, as the project I'm working on is still on 3.8. I'd be happy to also create this style PR for the v2 branch.
I might be missing something completely, but when I try to refresh the longAccessToken either through the URL from the cron documentation, or through the console command, I don't see it being updated in the Craftagram settings table.
I only see it being saved to the settings table during the Authorization flow.
Am I missing something or is the refresh token flow not working right now?
And I could have read the documentation... :facepalm: The refresh of a long access token does not replace it with a new token, but extends the expiration time of the original long access token. See the docs: https://developers.facebook.com/docs/instagram-basic-display-api/guides/long-lived-access-tokens#refresh-a-long-lived-token
So the long access token is supposed to remain unchanged.
I might be missing something completely, but when I try to refresh the longAccessToken either through the URL from the cron documentation, or through the console command, I don't see it being updated in the Craftagram settings table.
I only see it being saved to the settings table during the Authorization flow.
Am I missing something or is the refresh token flow not working right now?