Replaced labels with icons in the SR and Action badges
This commit is contained in:
@@ -103,14 +103,22 @@ function createAuthConsumerSession({
|
||||
const isHtmlFallback = error
|
||||
&& error.code === "INVALID_JSON_RESPONSE"
|
||||
&& error.httpStatus === 200;
|
||||
const isSessionUnauthorized = error && (error.httpStatus === 401 || error.httpStatus === 403);
|
||||
const needsSessionRecovery = isHtmlFallback || isSessionUnauthorized;
|
||||
const retryReason = isSessionUnauthorized
|
||||
? `HTTP ${error.httpStatus} response requires SPA session recovery`
|
||||
: "HTTP 200 response did not contain valid JSON";
|
||||
const debugEntry = debugRequests[debugRequests.length - 1];
|
||||
|
||||
if (!isHtmlFallback || attempt >= CUSTOMER_TOKEN_MAX_ATTEMPTS) {
|
||||
if (!needsSessionRecovery || attempt >= CUSTOMER_TOKEN_MAX_ATTEMPTS) {
|
||||
if (debugEntry) {
|
||||
debugEntry.metadata.attempt = String(attempt);
|
||||
if (isHtmlFallback) {
|
||||
if (needsSessionRecovery) {
|
||||
debugEntry.metadata.retryLimitReached = "true";
|
||||
debugEntry.error = `requestConsumerTokenService returned invalid JSON after ${CUSTOMER_TOKEN_MAX_ATTEMPTS} attempts.`;
|
||||
debugEntry.metadata.retryReason = retryReason;
|
||||
debugEntry.error = isHtmlFallback
|
||||
? `requestConsumerTokenService returned invalid JSON after ${CUSTOMER_TOKEN_MAX_ATTEMPTS} attempts.`
|
||||
: `requestConsumerTokenService failed with status ${error.httpStatus} after ${CUSTOMER_TOKEN_MAX_ATTEMPTS} attempts.`;
|
||||
error.message = debugEntry.error;
|
||||
}
|
||||
}
|
||||
@@ -138,7 +146,7 @@ function createAuthConsumerSession({
|
||||
const retryDelayMs = getConsumerTokenRetryDelay(attempt);
|
||||
if (debugEntry) {
|
||||
debugEntry.metadata.attempt = String(attempt);
|
||||
debugEntry.metadata.retryReason = "HTTP 200 response did not contain valid JSON";
|
||||
debugEntry.metadata.retryReason = retryReason;
|
||||
debugEntry.metadata.nextRetryDelayMs = String(retryDelayMs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user