Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DOCSP-26313): Swift: Add a Handle Sync Errors page for SwiftUI #2524

Merged
merged 13 commits into from
May 17, 2024

Conversation

dacharyc
Copy link
Collaborator

@dacharyc dacharyc commented Jan 26, 2023

Pull Request Info

Moved the client reset handling details off the page so we can merge this PR. When PR #8109 in the realm-swift repository gets released, we can re-test and add the client reset handling details to the page.

Jira

Staged Changes

Reminder Checklist

If your PR modifies the docs, you might need to also update some corresponding
pages. Check if completed or N/A.

  • Create Jira ticket for corresponding docs-app-services update(s), if any
  • Checked/updated Admin API
  • Checked/updated CLI reference

Release Notes

  • Swift SDK
    • SwiftUI/Handle Sync Errors: New page demonstrating how to set and use a sync error handler in SwiftUI.

Review Guidelines

REVIEWING.md

@github-actions
Copy link

github-actions bot commented Jan 26, 2023

Readability for Commit Hash: 4663354

You can see any previous Readability scores (if they exist) by looking
at the comment's history.

Readability scores for changed documents:

  • source/sdk/swift/swiftui: Grade Level: 8.6, Reading Ease: 52.15
  • source/sdk/swift/swiftui/handle-sync-errors: Grade Level: 9.1, Reading Ease: 51.04

For Grade Level, aim for 8 or below.

For Reading Ease scores, aim for 60 or above:

Score Difficulty
90-100 Very Easy
80-89 Easy
70-79 Fairly Easy
60-69 Medium
50-59 Fairly Hard
30-49 Hard
0-29 Very Hard

For help improving readability, try Hemingway App.

@dacharyc dacharyc marked this pull request as ready for review January 26, 2023 22:33
Copy link
Collaborator

@mongodben mongodben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice page! couple copy edits and questions on phrasing.

examples/ios/SwiftUICatalog/Views/Authenticate.swift Outdated Show resolved Hide resolved
let dogSubscriptionExists = subs.first(named: "dogs")
// Check whether the subscription already exists. Adding it more
// than once causes an error.
if (peopleSubscriptionExists != nil) && (dogSubscriptionExists != nil) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not needed to specified != than nil, you can

if peopleSubsriptionExist && dogSubscriptionExist {

or

if let peopleSubsriptionExist = subs.first(named: "people"), let dogSubscriptionExist = subs.first(named: "dogs") {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried updating this syntax, but I get an error message:

Optional type 'SyncSubscription?' cannot be used as a boolean; test for '!= nil' instead

That's why I originally had the != nil in the example. This seemed like the easiest way to bypass the optional unwrapping.

Copy link
Collaborator

@mongodben mongodben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! nice work. a couple additional small comments.

lmk if you'd like another review after any changes from sdk team feedback.

Copy link

@dianaafanador3 dianaafanador3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!! Just an small comment

@dacharyc dacharyc merged commit 406900f into mongodb:master May 17, 2024
6 checks passed
@dacharyc dacharyc deleted the DOCSP-26313 branch May 17, 2024 19:12
@docs-builder-bot
Copy link

@dacharyc dacharyc added the Add to consolidation feature branch PR merged after cutting the consolidation feature branch, so cherry-pick to the feature branch. label May 17, 2024
dacharyc added a commit that referenced this pull request Jun 24, 2024
Moved the client reset handling details off the page so we can merge
this PR. When PR #8109 in the realm-swift repository gets released, we
can re-test and add the client reset handling details to the page.

- https://jira.mongodb.org/browse/DOCSP-26313

- [Handle Sync
Errors](https://preview-mongodbdacharyc.gatsbyjs.io/realm/DOCSP-26313/sdk/swift/swiftui/handle-sync-errors/)

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

- Swift SDK
- SwiftUI/Handle Sync Errors: New page demonstrating how to set and use
a sync error handler in SwiftUI.

[REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md)
@dacharyc dacharyc removed the Add to consolidation feature branch PR merged after cutting the consolidation feature branch, so cherry-pick to the feature branch. label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants