You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using traditional online requests, when there is some issue, it is usually obvious: The request would fail, typically producing logs on the server and an error message on the client.
When using a sync engine, the cause is often removed from the symptoms: The offline query completes, but doesn't return the data the user expects, typically because it hasn't synced yet. But the reason for the data not syncing is often completely removed from the query. During development this is often debugged by checking client logs, but in production it becomes more difficult.
Some examples of potentially silent failures:
connect() was never called (status.connected == false && status.connecting == false).
Some error is present in the sync, including network errors, authentication errors, and temporary service errors (visible in downloadError).
There are pending operations in the upload queue, preventing downloads from being applied (need to query the queue).
The upload queue is clear, but the write checkpoint has not been acknowledged yet, possibly due to replication delays (need to query the write checkpoint).
Data is being synced, but is behind due to replication delays (has service alerts).
Data is being synced, but the expected data is not synced due to sync rule issues.
The idea
We want an easy way to identify the above scenarios for any particular user in production applications. It should:
Not require significant app-side code changes, such as implementing custom logging solutions.
Protect the user's privacy - no sensitive data should be sent without the user's consent.
Be easy to enable in an existing application in production.
Not introduce too much noise and/or overhead.
We should keep in mind that:
Having the information available on the service could be the most convenient place to debug the issue.
However, a big class of issues prevent connection to the service, either temporarily or permanently, so we also need a way to show the relevant failure info directly on the client.
Current workarounds
Some information is available in the client-side status updates, for example with the useStatus() hook in React. This includes:
Download errors.
Upload errors.
Connection status (not connected; connecting).
Sync in progress (downloading).
Last sync timestamp.
Busy uploading (uploading: true) - can be inferred to mean not applying changes due to pending uploads, but does not cover all cases.
However, there is a big class of issues missing, typically only visible in logs, if at all:
Replication delay.
Not applying changes due to pending write checkpoint.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Background
When using traditional online requests, when there is some issue, it is usually obvious: The request would fail, typically producing logs on the server and an error message on the client.
When using a sync engine, the cause is often removed from the symptoms: The offline query completes, but doesn't return the data the user expects, typically because it hasn't synced yet. But the reason for the data not syncing is often completely removed from the query. During development this is often debugged by checking client logs, but in production it becomes more difficult.
Some examples of potentially silent failures:
connect()
was never called (status.connected == false && status.connecting == false
).downloadError
).The idea
We want an easy way to identify the above scenarios for any particular user in production applications. It should:
We should keep in mind that:
Current workarounds
Some information is available in the client-side status updates, for example with the
useStatus()
hook in React. This includes:uploading: true
) - can be inferred to mean not applying changes due to pending uploads, but does not cover all cases.However, there is a big class of issues missing, typically only visible in logs, if at all:
Proposals
Pending proposals
Beta Was this translation helpful? Give feedback.
All reactions