Problem
fetch_exams() keeps the OAuth token in a static String token. After the first successful token fetch, the token is no longer "NOT_FOUND", so ensure_getting_token() skips its retry loop, leaves success = false, and returns failure.
This breaks any second fetch_exams() call during the same boot cycle, especially in exam_mode() where two calls are intentional.
Expected behavior
Repeated fetch_exams() calls in the same boot should either reuse a valid cached token correctly or request a fresh token when needed.
Suggested fix
Update ensure_getting_token() so cached tokens are treated as valid, or remove the static token cache entirely. Be careful with secret_verification(), which should not validate a new secret using an old cached token.
Problem
fetch_exams() keeps the OAuth token in a static String token. After the first successful token fetch, the token is no longer "NOT_FOUND", so ensure_getting_token() skips its retry loop, leaves success = false, and returns failure.
This breaks any second fetch_exams() call during the same boot cycle, especially in exam_mode() where two calls are intentional.
Expected behavior
Repeated fetch_exams() calls in the same boot should either reuse a valid cached token correctly or request a fresh token when needed.
Suggested fix
Update ensure_getting_token() so cached tokens are treated as valid, or remove the static token cache entirely. Be careful with secret_verification(), which should not validate a new secret using an old cached token.