Closed MikesGlitch closed 4 weeks ago
Name | Link |
---|---|
Latest commit | eef170d5fe57b633975c1eeab80511d7338f682d |
Latest deploy log | https://app.netlify.com/sites/actualbudget/deploys/67151238a6204800086a0da0 |
Deploy Preview | https://deploy-preview-3697.demo.actualbudget.org |
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.
Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.
As this PR is updated, I'll keep you updated on how the bundle size is impacted.
Total
Files count | Total bundle size | % Changed |
---|---|---|
9 | 5.31 MB | 0% |
Changeset
No files were changed
Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.
As this PR is updated, I'll keep you updated on how the bundle size is impacted.
Total
Files count | Total bundle size | % Changed |
---|---|---|
1 | 1.27 MB → 1.27 MB (+82 B) | +0.01% |
The changes in the pull request focus on enhancing the error handling mechanisms within the throwIfNot200
function located in the packages/loot-core/src/server/post.ts
file. A new feature has been introduced to detect tunnel errors, particularly in situations where the server is unreachable due to tunnel issues, such as when using ngrok. The implementation now includes a check for specific headers, namely ngrok-error-code
, in the response to identify these tunnel errors. Upon detection, the code throws a PostError
with the message 'network-failure'.
The existing error handling for non-200 responses is maintained, which includes specific handling for 500 status codes and JSON parsing errors. The overall structure of the post
function remains largely unchanged, but it now incorporates the new tunnel error handling within the throwIfNot200
function. Additionally, the postBinary
and get
functions have not been altered in this update, with no changes made to their logic or error handling. The primary focus of this modification is the improvement of error detection related to network failures caused by tunnel issues.
Why?
If the sync server is behind an active tunnel but the server is offline we get a error message like:
We get the error because the tunnel service says it can't connect to the server and we're not handling it.
This could be a common situation when the user wants to run the sync server on a computer in their house, but expose it to the internet for mobile use. Tunneling services like ngrok stay online forever, but If they turn their computer off the sync server goes offline.
This fix detects known tunnels (ngrok for now) and if the tunnel is telling us the server is offline we handle it as normal - we tell the user it's offline.
This was found while working on the desktop app server sync: https://github.com/actualbudget/actual/pull/3631