-
Notifications
You must be signed in to change notification settings - Fork 88
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
Swift: Add docs for SyncSession.reconnect() #3062
Conversation
Readability for Commit Hash: 3e6814b You can see any previous Readability scores (if they exist) by looking Readability scores for changed documents:
For Grade Level, aim for 8 or below. For Reading Ease scores, aim for 60 or above:
For help improving readability, try Hemingway App. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy updates LGTM, though I'm curious if .reconnect()
does apply to all sessions.
And FYI - the last example on the Configure & Open a Synced Realm page still uses PBS in the snippet: /examples/generated/code/start/Authenticate.snippet.offline-login.swift
offline and attempts to reconnect using an incremental backoff strategy. | ||
|
||
In Swift SDK version 10.44.0 and later, you can choose to manually trigger a | ||
reconnect attempt with ``SyncSession.reconnect()`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to link to the API ref here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swift doesn't have an API ref for this method, it seems - only Objective-C. I meant to ask about this in the tech review - I'll add a note to my PR description about it 👍
Yeah, that comes from a different test file - the |
reconnect() will skip the reconnect delay for all sessions in the same App regardless of if multiplexing is enabled. I think saying that it'll force a reconnect might be misleading, as it won't cause a reconnection if we got a fatal error. It also doesn't do anything if the connection isn't currently waiting to reconnect, i.e. if it's already connected or is in the process of trying to connect. On Apple platforms core listens for network change notifications and automatically triggers a reconnection immediately after receiving one. Some SDKs may implement similar logic for other platforms. A longstanding problem we've had with jazzy is that part of our Swift API is just re-exporting obj-c types, and jazzy doesn't include those things in the generated Swift docs. Since we're no longer working on jazzy, this is unlikely to ever get fixed. |
✨ Staging URL: https://preview-mongodbmongodb.gatsbyjs.io/realm/master/ 🪵 Logs |
Pull Request Info
A few questions for a tech reviewer based on the similar docs in Kotlin:
SyncSession
you call it on to reconnect? Does this change with session multiplexing enabled/disabled?Jira
Staged Changes
The rest of the examples in the test file were still using Partition-Based Sync, so I also updated those examples to FS. Those examples are at:
Reminder Checklist
If your PR modifies the docs, you might need to also update some corresponding
pages. Check if completed or N/A.
Review Guidelines
REVIEWING.md