From 8e7344f6a35b611e79cd07d57412022e98825fdf Mon Sep 17 00:00:00 2001 From: Adam Velebil Date: Thu, 12 May 2022 14:04:26 +0200 Subject: [PATCH] add refresh debug logs --- lib/android/oath/state.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/android/oath/state.dart b/lib/android/oath/state.dart index bf953b89..c63c667c 100755 --- a/lib/android/oath/state.dart +++ b/lib/android/oath/state.dart @@ -259,6 +259,7 @@ class _AndroidCredentialListNotifier extends OathCredentialListNotifier { _timer?.cancel(); if (_currentDevice == null) return; if (state == null) { + _log.debug('No OATH state, refresh immediately'); refresh(); } else if (mounted) { final expirations = (state ?? []) @@ -269,13 +270,16 @@ class _AndroidCredentialListNotifier extends OathCredentialListNotifier { .whereType() .map((e) => e.validTo); if (expirations.isEmpty) { + _log.debug('No expirations, no refresh'); _timer = null; } else { final earliest = expirations.reduce(min) * 1000; final now = DateTime.now().millisecondsSinceEpoch; if (earliest < now) { + _log.debug('Already expired, refresh immediately'); refresh(); } else { + _log.debug('Schedule refresh in ${earliest - now}ms'); _timer = Timer(Duration(milliseconds: earliest - now), refresh); } }