Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling Refresh on "findme" service > 5 mins after connect causes 'invalid json body' error #11

Open
davidcreager opened this issue Mar 5, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@davidcreager
Copy link

I'm probably doing something wrong -:(

I connect successfully, get the findme service, call refresh and all works

I can continue to get the service and call refresh for a few minutes (4-5), however then I get the 'Invalid Json response body' and have to reconnect.

After investigation, it seems that the fetch for the refresh is return an http code of 450 and an empty body.

@foxt
Copy link
Owner

foxt commented Mar 5, 2023

see also: picklepete/pyicloud#372
looks like we need to reauthenticate?

@davidcreager
Copy link
Author

Ok....that was a useful link/hint

I tried reauthenticating and then refreshing again when the refresh gets a return of 450. (I don't think I'm familiar enough with your design to presume to make a pull request)

It didn't quite work, although the next refresh did

I think you are missing an await when you call getiCloudCookies on line 88 in index.js, authenticate function.

I added await and all now seems good!!

Let me know if you want me to send any info or test.

This is by far the cleanest javascript icloud api I have come across Thanks for sharing your work. I am very hopeful it will satisfy my needs!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants