Closed kevin-dp closed 1 day ago
Should we make the onError handler async such that it can for instance fetch the new token asynchronously?
yeah, that'll be a common requirement.
Name | Link |
---|---|
Latest commit | 0e9f64679df126499d0222fca1391abe9e8fa720 |
Latest deploy log | https://app.netlify.com/sites/electric-next/deploys/673f43c7711aeb0008660b9d |
Deploy Preview | https://deploy-preview-2011--electric-next.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This PR modifies the
onError
handler that is supported by the shape stream such that it can recover from certain HTTP request errors. For example, if the HTTP request fails with a 401 because of an expired token, the handler could fetch a new token, and try again by returning the modified HTTP headers. The shapestream will then retry.Accompanying docs PR: https://github.com/electric-sql/electric/pull/2018