Describe the bug
Much like the title, I don't think this is a correct behavior, mostly because supabase-flutter is already doing this Nullish coalescing check anyway.
Future<AuthResponse> refreshSession([String? refreshToken]) async {
if (currentSession?.accessToken == null) {
_log.warning("Can't refresh session, no current session found.");
throw AuthSessionMissingException();
}
_log.info('Refresh session');
final currentSessionRefreshToken =
refreshToken ?? _currentSession?.refreshToken;
if (currentSessionRefreshToken == null) {
throw AuthSessionMissingException();
}
return await _callRefreshToken(currentSessionRefreshToken);
}
This code snippets, realistically only needs this piece of code:
if (currentSessionRefreshToken == null) {
throw AuthSessionMissingException();
}
The first one doesn't seem right to me. That check is also not doing anything, and blocks a valid use-case where you might have a refreshToken but no current session atm.