@@ -32,7 +32,6 @@ import {
|
32 | 32 | import { |
33 | 33 | appendQaLiveLaneIssue as appendLiveLaneIssue, |
34 | 34 | redactQaLiveLaneDetails, |
35 | | -redactQaLiveLaneIssues, |
36 | 35 | } from "../shared/live-artifacts.js"; |
37 | 36 | import { startQaLiveLaneGateway } from "../shared/live-gateway.runtime.js"; |
38 | 37 | import { |
@@ -2898,6 +2897,8 @@ const SAFE_WHATSAPP_DRIVER_DIAGNOSTICS_PATTERN =
|
2898 | 2897 | /observed \d+ WhatsApp driver message\(s\) after (?:(?:pending|resolved) approval )?wait lower bound(?:: [-A-Za-z0-9_#:=()., +;/]+)?/u; |
2899 | 2898 | const SAFE_WHATSAPP_PRE_SCENARIO_FAILURE_PATTERN = |
2900 | 2899 | /^WhatsApp QA failed during (?:auth archive unpack|credential heartbeat start|credential lease acquisition|driver session start|scenario execution)$/u; |
| 2900 | +const SAFE_WHATSAPP_CREDENTIAL_POOL_EXHAUSTED_PATTERN = |
| 2901 | +/Convex credential pool exhausted for kind "whatsapp" after \d+ms\./u; |
2901 | 2902 | |
2902 | 2903 | function formatWhatsAppPreScenarioFailureLabel(phase: WhatsAppQaPreScenarioPhase) { |
2903 | 2904 | return `WhatsApp QA failed during ${phase}`; |
@@ -2918,7 +2919,10 @@ function redactWhatsAppQaScenarioDetails(details: string) {
|
2918 | 2919 | const preScenarioFailureLabel = |
2919 | 2920 | separatorIndex < 0 ? firstLine.trim() : firstLine.slice(0, separatorIndex).trim(); |
2920 | 2921 | if (SAFE_WHATSAPP_PRE_SCENARIO_FAILURE_PATTERN.test(preScenarioFailureLabel)) { |
2921 | | -return preScenarioFailureLabel; |
| 2922 | +const poolExhausted = firstLine.match(SAFE_WHATSAPP_CREDENTIAL_POOL_EXHAUSTED_PATTERN); |
| 2923 | +return poolExhausted |
| 2924 | + ? `${preScenarioFailureLabel}: ${poolExhausted[0]}` |
| 2925 | + : preScenarioFailureLabel; |
2922 | 2926 | } |
2923 | 2927 | const safeDriverDiagnostics = normalized.match(SAFE_WHATSAPP_DRIVER_DIAGNOSTICS_PATTERN); |
2924 | 2928 | if (safeDriverDiagnostics) { |
@@ -2931,6 +2935,26 @@ function redactWhatsAppQaScenarioDetails(details: string) {
|
2931 | 2935 | return safeSegments.length > 0 ? safeSegments.join("; ") : redactQaLiveLaneDetails(); |
2932 | 2936 | } |
2933 | 2937 | |
| 2938 | +function redactWhatsAppQaCleanupIssue(issue: string) { |
| 2939 | +const firstLine = issue.split(/\r?\n/u, 1)[0] ?? ""; |
| 2940 | +const separatorIndex = firstLine.indexOf(":"); |
| 2941 | +const label = separatorIndex < 0 ? "" : firstLine.slice(0, separatorIndex).trim(); |
| 2942 | +if (!label) { |
| 2943 | +return redactQaLiveLaneDetails(); |
| 2944 | +} |
| 2945 | +if (SAFE_WHATSAPP_PRE_SCENARIO_FAILURE_PATTERN.test(label)) { |
| 2946 | +const poolExhausted = firstLine.match(SAFE_WHATSAPP_CREDENTIAL_POOL_EXHAUSTED_PATTERN); |
| 2947 | +if (poolExhausted) { |
| 2948 | +return `${label}: ${poolExhausted[0]}`; |
| 2949 | +} |
| 2950 | +} |
| 2951 | +return `${label}: ${redactQaLiveLaneDetails()}`; |
| 2952 | +} |
| 2953 | + |
| 2954 | +function redactWhatsAppQaCleanupIssues(issues: readonly string[]) { |
| 2955 | +return issues.map(redactWhatsAppQaCleanupIssue); |
| 2956 | +} |
| 2957 | + |
2934 | 2958 | function createMissingGroupJidScenarioResult(params: { |
2935 | 2959 | explicitScenarioSelection: boolean; |
2936 | 2960 | scenario: WhatsAppQaScenarioDefinition; |
@@ -2988,7 +3012,7 @@ async function buildPublishedWhatsAppQaRunView(params: {
|
2988 | 3012 | scenarioResults: WhatsAppQaScenarioResult[]; |
2989 | 3013 | }) { |
2990 | 3014 | const publishedCleanupIssues = params.redactMetadata |
2991 | | - ? redactQaLiveLaneIssues(params.cleanupIssues) |
| 3015 | + ? redactWhatsAppQaCleanupIssues(params.cleanupIssues) |
2992 | 3016 | : params.cleanupIssues; |
2993 | 3017 | const publishedScenarioResults = params.redactMetadata |
2994 | 3018 | ? redactWhatsAppQaScenarioResults(params.scenarioResults) |
|