OpenSourceFellows / amplify

Open Source Fellow Sandbox
https://amplify-app-production.herokuapp.com/
MIT License
78 stars 59 forks source link

Codespaces Bug(s) #398

Open paramsiddharth opened 1 year ago

paramsiddharth commented 1 year ago

Codespaces Bug(s)

Reported by @sammychinedu2ky.

paramsiddharth commented 1 year ago

To replicate error 1, we need to:

  1. Create a new Codespace.
  2. Set the Cicero API key in the .env file.
  3. Execute the development server for the front-end.
  4. Attempt to search by a zip code in any campaign. You'll encounter the gateway error in the browser console.
paramsiddharth commented 1 year ago

To replicate error 1, we need to:

  1. Create a new Codespace.
  2. Set the Cicero API key in the .env file.
  3. Execute the development server for the front-end.
  4. Attempt to search by a zip code in any campaign. You'll encounter the gateway error in the browser console.

@thyeggman

JamesMGreene commented 1 year ago

@paramsiddharth I'm confused on error 1 - the OP suggested it was a Lob API failure, but your repro steps would suggest it's a Cicero failure. 🤔 I haven't found any Cicero documentation that mentions a 502 as a possible error response but, by the looks of it, we have some custom code that could respond with 502 if there is a Lob API failure: server/routes/api/lob.js#L374

As for error 2 - I think Stripe has been a common point of downfall for local development. As far as I have seen, the only way to make Stripe work for local/Codespaces usage is to setup your own Stripe testing account so that you can appropriately configure the callback address. It's not very user friendly. 😢 P.S. I have not done so, otherwise I would share/document the steps. Sorry!

paramsiddharth commented 1 year ago

@paramsiddharth I'm confused on error 1 - the OP suggested it was a Lob API failure, but your repro steps would suggest it's a Cicero failure. 🤔 I haven't found any Cicero documentation that mentions a 502 as a possible error response but, by the looks of it, we have some custom code that could respond with 502 if there is a Lob API failure: server/routes/api/lob.js#L374

@JamesMGreene Pardon me, after checking it again with Sam we came to a different conclusion and the reproduction steps as we thought of them, changed:

  1. Create a new Codespace.
  2. Set the Cicero API key in the .env file.
  3. Execute the development server for the front-end.
  4. Search by a zip code inside any campaign.
  5. Login using Auth0 (the error happens even if you don't do this step).
  6. Select a representative on the left. You'll encounter the gateway error in the browser console, and the letter template won't be updated on the right.

As for error 2 - I think Stripe has been a common point of downfall for local development. As far as I have seen, the only way to make Stripe work for local/Codespaces usage is to setup your own Stripe testing account so that you can appropriately configure the callback address. It's not very user friendly. 😢 P.S. I have not done so, otherwise I would share/document the steps. Sorry!

I agree with you on that. Especially when it gets to webhooks atl., we end up having to use tunnelling on local systems, which gets even more complicated on GitHub Codespaces I suppose. Nevertheless, after @DietBepis1's PR gets merged, I'll try to have more conversations on that and see if we are able to figure something out in order to emulate the behaviour in a local development environment. 😊