feat: Enhance messaging read receipts and auto-read, fix auth 401 error suppression during logout, and refine agent profile expertise
This commit is contained in:
@@ -14,6 +14,9 @@ class ApiClient {
|
||||
bool _isRefreshing = false;
|
||||
final List<_QueuedRequest> _failedQueue = [];
|
||||
|
||||
// Suppress 401 errors during logout to prevent SnackBar flashing
|
||||
static bool suppressAuthErrors = false;
|
||||
|
||||
// Callback to notify app of forced logout
|
||||
static void Function()? onForceLogout;
|
||||
|
||||
@@ -60,6 +63,12 @@ class ApiClient {
|
||||
onError: (error, handler) async {
|
||||
// Handle 401 — attempt token refresh
|
||||
if (error.response?.statusCode == 401) {
|
||||
// During logout, silently reject 401s without showing errors
|
||||
if (suppressAuthErrors) {
|
||||
handler.reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
final requestUrl = error.requestOptions.path;
|
||||
|
||||
// Don't try to refresh if this was the refresh request itself
|
||||
|
||||
Reference in New Issue
Block a user