(signals, classification)
| 158 | // Remember a suppressed report locally so it is observable and dedup-tracked, |
| 159 | // without opening a public issue. |
| 160 | function recordSuppression(signals, classification) { |
| 161 | try { |
| 162 | const state = readState(); |
| 163 | const errorKey = computeErrorKey(signals); |
| 164 | let recentKeys = Array.isArray(state.recentIssueKeys) ? state.recentIssueKeys : []; |
| 165 | if (!recentKeys.includes(errorKey)) recentKeys.push(errorKey); |
| 166 | if (recentKeys.length > 20) recentKeys = recentKeys.slice(-20); |
| 167 | writeState(Object.assign({}, state, { |
| 168 | recentIssueKeys: recentKeys, |
| 169 | lastSuppressedAt: new Date().toISOString(), |
| 170 | lastSuppressedBucket: classification.bucket, |
| 171 | lastSuppressedReason: classification.reason, |
| 172 | })); |
| 173 | } catch (_) {} |
| 174 | } |
| 175 | |
| 176 | function formatRecentEvents(events) { |
| 177 | if (!Array.isArray(events) || events.length === 0) return '_No recent events available._'; |
no test coverage detected