refreshLoginUsersCache method
Refreshes the login-users cache from backend. This should only run while a user is already authenticated.
Implementation
Future<void> refreshLoginUsersCache() async {
if (_refreshingLoginUsers) return;
if (await _c_user == null) return;
_refreshingLoginUsers = true;
try {
debugPrint('Refreshing login users cache from backend...');
final users = await remote.getLoginUsers();
debugPrint('Login users fetched from backend: ${users.length}');
await _storeLoginUsers(users);
debugPrint('Cached login users updated: ${users.length}');
} catch (e) {
debugPrint('Could not refresh login users cache: $e');
} finally {
_refreshingLoginUsers = false;
}
}