Closed fooman closed 4 years ago
Hi @fooman. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
I believe it's default is to retry every failed call 5 times, that's why the errors start to pile up. What we figured is that if we get a 503 we go show a maintenance page. Not sure if we can do the same for 500's
@Jordaneisenburger is correct, the retry link should limit it to some number like 5. If you're seeing an excessive amount of calls there may be some buggy logic in the code that is attempting a retry beyond what is handled by Apollo. Can you provide steps to repro the errors? Was it any gql call that resulted in 500 or was it a specific call?
Created PWA-732 in Jira backlog for further grooming
Any graphql was returning a 500 error. Something like this reproduces it for me.
yarn build edit packages/venia-concept/dist/upward.yml
veniaProxy:
inline:
status: 500
headers:
resolver: inline
inline:
content-type: text/html
body:
headers:
resolver: inline
inline: NOT OK
cd packages/venia-concept yarn start
Open site.
There is also this message
client.d7d157a7dfd7446e50e4.js:1027 Unhandled ApolloError30W Error: Network error: Response not successful: Received status code 500
@fooman I'm looking into this now - I'm able to replicate without modifying files - just clear cache and block <your-domain>/graphl
network requests in chrome's dev tools (or via a proxy mechanism).
At a glance it looks like the logic in our actions were not written to handle unrecoverable errors. They all assume that an error is retry-able. In this case, if there is no cart id, we ask /graphql for one. If it errors, we log the error (as you can see with the toast) but then we immediately retry the action because we assume it was successful.
Is your feature request related to a problem? Please describe. If the backend is experiencing issues (ie responding with a server 500 error) PWA Studio aggressively keeps trying to reconnect.
Describe the solution you'd like Ideally some retry logic is added to the reconnect to back off after a certain number of fails. Also the user frontend would benefit from only 1 toast message per issue rather than hundreds.
Please let us know what packages this feature is in regards to:
venia-concept
venia-ui
pwa-buildpack
peregrine
pwa-devdocs
upward-js
upward-spec
create-pwa