Closed thruflo closed 3 hours ago
Name | Link |
---|---|
Latest commit | 65269be279a56d4c0c16807ac2d36831a83e91ba |
Latest deploy log | https://app.netlify.com/sites/electric-next/deploys/673f71e2f222740008457bd7 |
Deploy Preview | https://deploy-preview-2028--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.
409 must-refetch responses never would reach onError
— https://github.com/electric-sql/electric/blob/e9813969dccb679ab763773205f59a3fe7166bdc/packages/typescript-client/src/client.ts#L371-L377
So the stream handles it and the shape gets the instruction in a control message?
Makes sense, cool.
So the stream handles it and the shape gets the instruction in a control message?
yeah exactly — the shape just resets its materialized view and recreates it — subscribers would never notice
This is what I requested in https://github.com/electric-sql/electric/pull/2018#issuecomment-2491085763
The client now uses the new onError to handle 401/403 and reconnect with a new auth token.
One observation: with the onError being defined before the shape is instantiated, I'm not sure what the best control flow is to handle a
405
must refetch. Certainly it's hard to handle in the onError callback. I guess this is what's being discussed in https://github.com/electric-sql/electric/issues/1997 etc.