Closed jdetter closed 4 weeks ago
How are you implementing reconnection that's broken right now? The only way we currently intend to support is by constructing an entirely new DbConnection
. Assuming a correct implementation of the SDK API spec, this should share zero state with the former connection.
One could imagine, in the future, adding a mechanism for a DbConnection
to attempt to reconnect, automatically resuming its subscriptions &c, but to the best of my knowledge no such thing currently exists.
How are you implementing reconnection that's broken right now? The only way we currently intend to support is by constructing an entirely new
DbConnection
. Assuming a correct implementation of the SDK API spec, this should share zero state with the former connection.One could imagine, in the future, adding a mechanism for a
DbConnection
to attempt to reconnect, automatically resuming its subscriptions &c, but to the best of my knowledge no such thing currently exists.
Yeah that's how I was implementing reconnections is essentially by just creating an entirely new DbConnection and redoing all of the connection logic. I think there was a discussion in discord about this so I won't rehash it but I think the plan for now is that you must create a new DbConnection when reconnecting, although as you say it would be easy to improve this in the future with just allowing reconnections (even possibly automatically reconnecting).
This is required for iOS certification. The app needs to be able to reconnect to the server without reloading the app.
I've opened this PR which fixes some surface level issues: https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/pull/168
However, indexes are broken right now because of some static data we're holding onto after a connection is lost. This needs to be fixed in order for the game to operate correctly after a reconnection.