raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.37k stars 3.07k forks source link

[Monzo] ... #4121

Closed mspych closed 1 year ago

mspych commented 1 year ago

Extension

https://www.raycast.com/danpalmer/monzo

Description

After initially connecting the extension stopped working. No transaction are showing.

Steps To Reproduce

Launch the extension

Current Behaviour

Failed to fetch latest data error is returned

Expected Behaviour

Transactions should be pulled

raycastbot commented 1 year ago

Thank you for opening this issue!

🔔 @danpalmer you might want to have a look.

danpalmer commented 1 year ago

Thanks will take another look. I've heard a similar report but not managed to reproduce in development and the stacktrace from prod builds didn't yield anything clear.

mspych commented 1 year ago

hey @danpalmer did you have a chance to look into this issue? I can send the logs if helpful.

raycastbot commented 1 year ago

This issue has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊

danpalmer commented 1 year ago

Thanks @raycastbot for the ping. I've done some more investigation here. I can reproduce this issue, it seems to be that refresh tokens stop working correctly after a while.

I noticed this code in the refresh function:

const tokenResponse = (await response.json()) as OAuth.TokenResponse;
tokenResponse.refresh_token = tokenResponse.refresh_token ?? refreshToken;
return tokenResponse;

Line 2 defaults the refresh token to the old refresh token. The Monzo docs aren't clear, but I suspect this is not allowed, and causes refresh tokens to get out of step, and therefore invalid.

I'm going to try removing this line and see if it works. I'll re-test over the next few days and submit a fix if it's all ok.

raycastbot commented 1 year ago

This issue has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊

raycastbot commented 1 year ago

This issue has been automatically closed due to inactivity.

Feel free to comment in the thread when you're ready to continue working on it 🙂

You can also catch us in Slack if you want to discuss this.

danpalmer commented 1 year ago

I actually fixed this in the end, should be all working.