TF-2271 Implement dns lookup to get jmap url

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 7b0c0015a15a243b6b4aef3d78e7653d556ad109)
This commit is contained in:
dab246
2023-11-10 17:06:50 +07:00
committed by Dat Vu
parent c0bef69435
commit 9b661b0688
33 changed files with 773 additions and 483 deletions
@@ -14,7 +14,6 @@ class GetSessionSuccess extends UIState {
}
class GetSessionFailure extends FeatureFailure {
final dynamic remoteException;
GetSessionFailure({dynamic exception, this.remoteException}) : super(exception: exception);
GetSessionFailure(dynamic exception) : super(exception: exception);
}
@@ -20,22 +20,19 @@ class GetSessionInteractor {
if (PlatformInfo.isMobile) {
yield* _getStoredSessionFromCache(remoteException: e);
} else {
yield Left<Failure, Success>(GetSessionFailure(exception: e));
yield Left<Failure, Success>(GetSessionFailure(e));
}
}
}
Stream<Either<Failure, Success>> _getStoredSessionFromCache({dynamic remoteException}) async* {
try {
log('GetSessionInteractor::_getStoredSessionFromCache:');
log('GetSessionInteractor::_getStoredSessionFromCache:remoteException: $remoteException');
yield Right<Failure, Success>(GetSessionLoading());
final session = await sessionRepository.getStoredSession();
yield Right<Failure, Success>(GetSessionSuccess(session));
} catch (e) {
yield Left<Failure, Success>(GetSessionFailure(
exception: e,
remoteException: remoteException
));
yield Left<Failure, Success>(GetSessionFailure(remoteException ?? e));
}
}
}