feat(llc, persistence): add support for open and close persistence via client.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-06-02 12:24:04 +05:30
committed by xsahil03x
parent 156c0a9aba
commit 6b29630a64
6 changed files with 103 additions and 53 deletions
@@ -1379,13 +1379,14 @@ class Channel {
this.state?.updateChannelState(updatedState);
return updatedState;
} catch (e) {
if (!_client.persistenceEnabled) {
rethrow;
if (_client.persistenceEnabled) {
return _client.chatPersistenceClient!.getChannelStateByCid(
cid!,
messagePagination: messagesPagination,
);
}
return _client.chatPersistenceClient!.getChannelStateByCid(
cid!,
messagePagination: messagesPagination,
);
rethrow;
}
}
@@ -1841,9 +1842,7 @@ class ChannelClientState {
/// [isUpToDate] flag count as a stream.
Stream<bool> get isUpToDateStream => _isUpToDateController.stream;
final BehaviorSubject<bool> _isUpToDateController =
BehaviorSubject.seeded(true);
final _isUpToDateController = BehaviorSubject.seeded(true);
/// The retry queue associated to this channel.
late final RetryQueue _retryQueue;