fix(cnb): delete all cache before execute logout
(cherry picked from commit 7aa346984f9f1a65005a8cc8c0670fdade6502e3)
This commit is contained in:
@@ -448,6 +448,8 @@ abstract class BaseController extends GetxController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await clearAllMailDataCached();
|
||||||
|
|
||||||
_isFcmEnabled = _isFcmActivated(session, accountId);
|
_isFcmEnabled = _isFcmActivated(session, accountId);
|
||||||
if (isAuthenticatedWithOidc) {
|
if (isAuthenticatedWithOidc) {
|
||||||
consumeState(logoutOidcInteractor.execute());
|
consumeState(logoutOidcInteractor.execute());
|
||||||
@@ -558,6 +560,17 @@ abstract class BaseController extends GetxController
|
|||||||
removeAllPageAndGoToLogin();
|
removeAllPageAndGoToLogin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> clearAllMailDataCached() async {
|
||||||
|
try {
|
||||||
|
await cachingManager.clearMailDataCached();
|
||||||
|
if (PlatformInfo.isMobile) {
|
||||||
|
await cachingManager.clearAllFileInStorage();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
logError('BaseController::clearAllMailDataCached:Exception = $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> clearAllData() async {
|
Future<void> clearAllData() async {
|
||||||
try {
|
try {
|
||||||
if (isAuthenticatedWithOidc) {
|
if (isAuthenticatedWithOidc) {
|
||||||
|
|||||||
@@ -73,12 +73,20 @@ class CachingManager {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Future<void> clearAll() async {
|
Future<void> clearAll() async {
|
||||||
|
await Future.wait([
|
||||||
|
clearMailDataCached(),
|
||||||
|
_fcmCacheManager.clear(),
|
||||||
|
_accountCacheManager.clear(),
|
||||||
|
if (PlatformInfo.isIOS)
|
||||||
|
_keychainSharingManager.delete()
|
||||||
|
], eagerError: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> clearMailDataCached() async {
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
_stateCacheManager.clear(),
|
_stateCacheManager.clear(),
|
||||||
_mailboxCacheManager.clear(),
|
_mailboxCacheManager.clear(),
|
||||||
_emailCacheManager.clear(),
|
_emailCacheManager.clear(),
|
||||||
_fcmCacheManager.clear(),
|
|
||||||
_accountCacheManager.clear(),
|
|
||||||
if (PlatformInfo.isMobile)
|
if (PlatformInfo.isMobile)
|
||||||
...[
|
...[
|
||||||
_sessionCacheManager.clear(),
|
_sessionCacheManager.clear(),
|
||||||
@@ -86,8 +94,6 @@ class CachingManager {
|
|||||||
_openedEmailCacheManager.clear(),
|
_openedEmailCacheManager.clear(),
|
||||||
_sendingEmailCacheManager.clearAllSendingEmails(),
|
_sendingEmailCacheManager.clearAllSendingEmails(),
|
||||||
],
|
],
|
||||||
if (PlatformInfo.isIOS)
|
|
||||||
_keychainSharingManager.delete()
|
|
||||||
], eagerError: true);
|
], eagerError: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user