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

getAccountInfo() Fails In 0.1.199 and Above #219

Closed
reynoldsalec opened this issue Feb 24, 2023 · 14 comments
Closed

getAccountInfo() Fails In 0.1.199 and Above #219

reynoldsalec opened this issue Feb 24, 2023 · 14 comments

Comments

@reynoldsalec
Copy link

@gilzow and I have been trying to resolve a bug with the Platform.sh Lando integration, where upon running a lando init, we are unable to retrieve the user's project list via the getAccountInfo() function provided by platformsh-client-js.

Specifically the line that produces the ultimate error in Lando is https://github.com/lando/platformsh/blob/main/recipes/platformsh/init.js#L35

While trying different versions of platformsh-client, I did notice a change in behavior between 0.1.198 and 0.1.199 of platformsh-client-js; both versions fail to produce the project list, but on 0.1.198 no explicit error is produced (the process just seems to hang). It looks like the underlying function powering getAccountInfo() changed, as did the version of isomorphic-fetch...perhaps one of these changes might have produced this error? v0.1.198...v0.1.199

Hoping that your finely tuned eyes notice something I haven't, happy to jump on a screenshare if that's easier, should be able to ping me via Slack if you join the #lando-platformsh shared channel.

@rfay
Copy link

rfay commented Mar 13, 2023

@gilzow could you please follow up here, and maybe we can figure out what's wrong here, and why it's not being caught by automated tests? Who would be the responsible person to assign this to?

@gilzow
Copy link

gilzow commented Mar 15, 2023

0.1.199 was released almost a year ago. @reynoldsalec have you tried updating the client to a more recent version? Is the error still present with a newer version of the client?

@reynoldsalec
Copy link
Author

@gilzow yep, currently packaged version since the last release (December 12th) was 0.1.217: https://github.com/lando/platformsh/blob/main/yarn.lock#L3915

The reason I brought up 0.1.199 in particular is because the change in behavior I noticed when running all the versions trying to find an older version than 0.1.217 that would work.

@gilzow
Copy link

gilzow commented Mar 15, 2023

Gotcha. Just wanted to clarify.

@tlattimore / @shakaman - any ideas on what might be causing the issue above?

@tlattimore
Copy link
Collaborator

I will investigate this further but I can confirm the issue was introduced with the isomorphic-fetch bump in 0.1.199. The issue we are seeing has been reported by others at matthew-andrews/isomorphic-fetch#194. If anything, we can investigate moving away from isomorphic-fetch altogether.

@tlattimore
Copy link
Collaborator

@reynoldsalec regarding,

The reason I brought up 0.1.199 in particular is because the change in behavior I noticed when running all the versions trying to find an older version than 0.1.217 that would work.

Is it reasonable to assume it is just at version 0.1.217 is because that's the last time yarn install was run? I ask just to verify and check there isn't another reason you're at that version.

@reynoldsalec
Copy link
Author

Exactly @tlattimore, that was the last time yarn install was run when the release was packaged up.

Good to hear RE: isomorphis-fetch...that was my suspicion based on "what changed" in those modules, but good catch with that issue. I'll dig into that and see if there's anything clever we can do to adapt in the short term.

Do you have any plans to move away from isomorphic-fetch?

tlattimore added a commit that referenced this issue Mar 27, 2023
Migrate to cross-fetch polyfill to eliminate the issues we are seeing
with isomorphic-fetch.
@tlattimore
Copy link
Collaborator

tlattimore commented Mar 27, 2023

I have started working this branch to test moving away from it isomorphic-fetch. Will be testing a bit more before we move forward with that.

@reynoldsalec
Copy link
Author

Awesome, thanks @tlattimore, that is huge.

@gilzow
Copy link

gilzow commented Apr 18, 2023

@tlattimore has there been any updates to your branch you're working on? This issue is a pretty substantial road block for platform.sh customers who are using lando for their local development.

shakaman pushed a commit that referenced this issue Apr 19, 2023
Migrate to cross-fetch polyfill to eliminate the issues we are seeing
with isomorphic-fetch.
shakaman added a commit that referenced this issue Apr 19, 2023
shakaman added a commit that referenced this issue Apr 19, 2023
@tlattimore
Copy link
Collaborator

Hey @gilzow, this should now be resolved with 0.1.230 which is now available on npm.

@gilzow
Copy link

gilzow commented Apr 20, 2023

@tlattimore PERFECT! Thank you!
@reynoldsalec Can you try updating the lando platform plugin with this latest version and see if this corrects the issue? Thanks!

@reynoldsalec
Copy link
Author

Awesome @tlattimore, I'll try updating this later today or tomorrow, thanks for the great work!

@reynoldsalec
Copy link
Author

I think this resolved the issue...was still having a problem when trying with my account, but after refreshing my token it worked perfectly. Relevant tests seem to pass.

Going to roll this into our next Lando release, thanks again @tlattimore for your help and @gilzow + @rfay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants