From 8e1f3da06315fd5990ef60034602b8108e4e133a Mon Sep 17 00:00:00 2001 From: Dachary Date: Wed, 11 Jan 2023 17:16:16 -0500 Subject: [PATCH] (DOCSP-27391): Add a link to App Services Sync Errors from SDKs (#2485) ## Pull Request Info This PR is a quick bandaid to expose more information about Sync errors in the SDK docs in response to this issue: https://github.com/mongodb/docs-realm/issues/2481 We should follow up with a larger project to expand our Sync error handling documentation across SDKs, and ensure consistency with API documentation & documented error codes in Core. ### Jira - https://jira.mongodb.org/browse/DOCSP-27391 ### Staged Changes - [Handle Sync Errors - Flutter SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-27391/sdk/flutter/sync/handle-sync-errors/) - [Sync Changes Between Devices - Java SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-27391/sdk/java/examples/sync-changes-between-devices/#handle-sync-errors) - [Handle App Errors - Kotlin SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-27391/sdk/kotlin/errors/app/#sync-errors) - [Handle Sync Errors - .NET SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-27391/sdk/dotnet/sync/handle-sync-errors/) - [Sync Changes Between Devices - Node.js SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-27391/sdk/node/examples/sync-changes-between-devices/#handle-sync-errors) - [Handle Sync Errors - React Native SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-27391/sdk/react-native/sync-data/handle-sync-errors/) - [Handle Sync Errors - Swift SDK](https://docs-mongodbcom-staging.corp.mongodb.com/realm/docsworker-xlarge/DOCSP-27391/sdk/swift/sync/handle-sync-errors/) ### Reminder Checklist If your PR modifies the docs, you might need to also update some corresponding pages. Check if completed or N/A. - [x] Create Jira ticket for corresponding docs-app-services update(s), if any - [x] Checked/updated Admin API - [x] Checked/updated CLI reference ### Review Guidelines [REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md) --- source/includes/sync-errors-in-app-services.rst | 4 ++++ source/sdk/dotnet/sync/handle-sync-errors.txt | 2 ++ source/sdk/flutter/sync/handle-sync-errors.txt | 2 ++ source/sdk/java/examples/sync-changes-between-devices.txt | 2 ++ source/sdk/kotlin/errors/app.txt | 2 ++ source/sdk/node/examples/sync-changes-between-devices.txt | 1 + source/sdk/react-native/sync-data/handle-sync-errors.txt | 2 ++ source/sdk/swift/sync/handle-sync-errors.txt | 2 ++ 8 files changed, 17 insertions(+) create mode 100644 source/includes/sync-errors-in-app-services.rst diff --git a/source/includes/sync-errors-in-app-services.rst b/source/includes/sync-errors-in-app-services.rst new file mode 100644 index 0000000000..5d72e144fa --- /dev/null +++ b/source/includes/sync-errors-in-app-services.rst @@ -0,0 +1,4 @@ +.. tip:: + + For a list of common Device Sync errors and how to handle them, refer to + :ref:`sync-errors` in the App Services Device Sync documentation. \ No newline at end of file diff --git a/source/sdk/dotnet/sync/handle-sync-errors.txt b/source/sdk/dotnet/sync/handle-sync-errors.txt index 830d8a06c4..ca10a2a72e 100644 --- a/source/sdk/dotnet/sync/handle-sync-errors.txt +++ b/source/sdk/dotnet/sync/handle-sync-errors.txt @@ -27,6 +27,8 @@ strongly typed handling logic. `HelpLink `_ property on the exception contains a link to the associated log entry. +.. include:: /includes/sync-errors-in-app-services.rst + .. _dotnet-reset-a-client-realm-file: .. Reset a Client Realm File diff --git a/source/sdk/flutter/sync/handle-sync-errors.txt b/source/sdk/flutter/sync/handle-sync-errors.txt index bd83b8589e..e667c9ebeb 100644 --- a/source/sdk/flutter/sync/handle-sync-errors.txt +++ b/source/sdk/flutter/sync/handle-sync-errors.txt @@ -31,6 +31,8 @@ If you do not specify a ``syncErrorHandler``, the default behavior is to print t .. literalinclude:: /examples/generated/flutter/open_flexible_sync_realm_test.snippet.sync-error-handler.dart :language: dart +.. include:: /includes/sync-errors-in-app-services.rst + .. _flutter-client-reset: Client Reset diff --git a/source/sdk/java/examples/sync-changes-between-devices.txt b/source/sdk/java/examples/sync-changes-between-devices.txt index d827f4cc69..fee87d9ffe 100644 --- a/source/sdk/java/examples/sync-changes-between-devices.txt +++ b/source/sdk/java/examples/sync-changes-between-devices.txt @@ -255,6 +255,8 @@ builder method: :language: java :copyable: false +.. include:: /includes/sync-errors-in-app-services.rst + .. _java-reset-a-client-realm-file: Reset a Client Realm File diff --git a/source/sdk/kotlin/errors/app.txt b/source/sdk/kotlin/errors/app.txt index 80d6af396f..e763aac2e6 100644 --- a/source/sdk/kotlin/errors/app.txt +++ b/source/sdk/kotlin/errors/app.txt @@ -130,6 +130,8 @@ Sync errors occur when Device Sync fails. `SyncException <{+kotlin-sync-prefix+}io.realm.kotlin.mongodb.exceptions/-sync-exception/index.html>`__ +.. include:: /includes/sync-errors-in-app-services.rst + Unrecoverable Sync Errors ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/sdk/node/examples/sync-changes-between-devices.txt b/source/sdk/node/examples/sync-changes-between-devices.txt index 6c127d32b8..c0b37847df 100644 --- a/source/sdk/node/examples/sync-changes-between-devices.txt +++ b/source/sdk/node/examples/sync-changes-between-devices.txt @@ -218,6 +218,7 @@ Set an error handler by registering an error callback as part of the :js-sdk:`Sy .. literalinclude:: /examples/generated/node/sync-changes-between-devices.snippet.sync-changes-between-devices-handle-sync-errors.js :language: javascript +.. include:: /includes/sync-errors-in-app-services.rst .. _node-perform-a-client-reset: diff --git a/source/sdk/react-native/sync-data/handle-sync-errors.txt b/source/sdk/react-native/sync-data/handle-sync-errors.txt index ade65d15be..8c7cb1a64a 100644 --- a/source/sdk/react-native/sync-data/handle-sync-errors.txt +++ b/source/sdk/react-native/sync-data/handle-sync-errors.txt @@ -22,6 +22,8 @@ Set an error handler by registering an error callback as part of the :js-sdk:`Sy .. literalinclude:: /examples/generated/node/sync-changes-between-devices.snippet.sync-changes-between-devices-handle-sync-errors.js :language: javascript +.. include:: /includes/sync-errors-in-app-services.rst + .. note:: Client Reset Errors To learn more about handling client reset errors, read the :ref:`Reset a Client Realm ` documentation. \ No newline at end of file diff --git a/source/sdk/swift/sync/handle-sync-errors.txt b/source/sdk/swift/sync/handle-sync-errors.txt index 30518ff761..f629339ce7 100644 --- a/source/sdk/swift/sync/handle-sync-errors.txt +++ b/source/sdk/swift/sync/handle-sync-errors.txt @@ -18,6 +18,8 @@ While developing an application that uses Device Sync, you should set an error handler. This error handler will detect and respond to any failed sync-related API calls. +.. include:: /includes/sync-errors-in-app-services.rst + .. tabs-realm-languages:: .. tab::