Skip to content

Commit

Permalink
Made connection field id and recoveryKey as sync instead of async
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Feb 22, 2024
1 parent 5f40d84 commit 7609df0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/platform/src/realtime/connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Connection extends PlatformObject {
on().listen((event) {
_state = event.current;
_errorReason = event.reason;
invoke<String?>(PlatformMethod.connectionId).then((_id) => id = _id);
});
}

Expand All @@ -37,7 +38,7 @@ class Connection extends PlatformObject {

/// A unique public identifier for this connection, used to identify this
/// member.
Future<String?> get id => invoke<String?>(PlatformMethod.connectionId);
String? id;

/// A unique private connection key used to recover or resume a connection,
/// assigned by Ably.
Expand All @@ -56,7 +57,7 @@ class Connection extends PlatformObject {
/// See [connection state recover options](https://ably.com/docs/realtime/connection#connection-state-recover-options)
/// for more information.
@Deprecated('Use createRecoveryKey instead')
Future<String?> get recoveryKey => createRecoveryKey();
String? recoveryKey;

/// The createRecoveryKey returns key string can be used by another client to
/// recover this connection's state in the recover client options property.
Expand Down

0 comments on commit 7609df0

Please sign in to comment.