Fix TokenStorage stale cache bug and add user-friendly error messages

- Fix TokenStorage.getToken() returning stale cached token after login/logout
- Add comprehensive ErrorMessageParser with 80+ error code mappings
- Add Suite9 and Suite10 UI test files for E2E integration testing
- Fix accessibility identifiers in RegisterView and ResidenceFormView
- Fix UITestHelpers logout to target alert button specifically
- Update various UI components with proper accessibility identifiers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-17 11:48:35 -06:00
parent b05e52521f
commit bcd8b36a9b
24 changed files with 1653 additions and 232 deletions

View File

@@ -9,7 +9,7 @@ package com.example.casera.network
*/
object ApiConfig {
// ⚠️ CHANGE THIS TO TOGGLE ENVIRONMENT ⚠️
val CURRENT_ENV = Environment.DEV
val CURRENT_ENV = Environment.LOCAL
enum class Environment {
LOCAL,

View File

@@ -33,10 +33,9 @@ object TokenStorage {
fun getToken(): String? {
ensureInitialized()
// Return cached token if available, otherwise try to load from storage
if (cachedToken == null) {
cachedToken = tokenManager?.getToken()
}
// Always read from storage to avoid stale cache issues
// (DataManager.setAuthToken updates tokenManager directly, bypassing our cachedToken)
cachedToken = tokenManager?.getToken()
return cachedToken
}