Skip to content

Replicator Should Proactively Check Network Status #3418

@bdkjones

Description

@bdkjones

In the 3.2.4 SDK, when an Internet connection is lost, Replicator seems to use a back-off strategy to attempt to reconnect. The trouble with this approach is that once an Internet connection is restored, it's often a long while until the replicator is back online.

A Better Alternative:

Use https://github.com/ashleymills/Reachability.swift. The SDK can be immediately notified when Internet is available again and then reconnect the replicator instantly. It doesn't have to poll.

This also lets the SDK differentiate between "connection lost because the device has no Internet" and "connection lost because something sever-side has failed," which is a great advantage. In the former case (which is FAR more likely), polling is not needed and the replicator can simply wait until it's told that the device has Internet again. In the latter case, you can still use the back-off strategy to attempt reconnections.

This would be a great improvement/modernization for the SDK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions