Skip to content

Commit ab24ac1

Browse files
authored
include parent tx and deposit in Slack alerts (#60)
1 parent 705d091 commit ab24ac1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/retryable-monitor/handlers/notion/alertUntriagedRetraybles.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export const alertUntriagedNotionRetryables = async () => {
4949
const timeoutRaw = props?.timeoutTimestamp?.date?.start
5050
const timeoutStr = formatDate(timeoutRaw)
5151
const retryableUrl = props?.ChildTx?.title?.[0]?.text?.content || '(unknown)'
52+
const parentTx = props?.ParentTx?.rich_text?.[0]?.text?.content || '(unknown)'
53+
const deposit = props?.TotalRetryableDeposit?.rich_text?.[0]?.text?.content || '(unknown)'
5254
const decision = props?.Decision?.select?.name || '(unknown)'
5355

5456
const expiryTime = timeoutRaw ? new Date(timeoutRaw).getTime() : Infinity
@@ -59,15 +61,15 @@ export const alertUntriagedNotionRetryables = async () => {
5961

6062
if (decision === 'Triage') {
6163
if (hoursLeft <= 72) {
62-
message = `🚨🚨 Retryable ticket needs **IMMEDIATE** triage (expires soon!):\n• Retryable: ${retryableUrl}\n• Timeout: ${timeoutStr}\n→ Please triage urgently.`
64+
message = `🚨🚨 Retryable ticket needs IMMEDIATE triage (expires soon!):\n• Retryable: ${retryableUrl}\n• Timeout: ${timeoutStr}\n• Parent Tx: ${parentTx}\n• Deposit: ${deposit}\n→ Please triage urgently.`
6365
} else {
64-
message = `⚠️ Retryable ticket needs triage:\n• Retryable: ${retryableUrl}\n• Timeout: ${timeoutStr}\n→ Please review and decide whether to redeem or ignore.`
66+
message = `⚠️ Retryable ticket needs triage:\n• Retryable: ${retryableUrl}\n• Timeout: ${timeoutStr}\n• Parent Tx: ${parentTx}\n• Deposit: ${deposit}\n→ Please review and decide whether to redeem or ignore.`
6567
}
6668
} else if (decision === 'Should Redeem') {
67-
if (!isNearExpiry(timeoutRaw)) continue // Skip if not near expiry
68-
message = `🚨 Retryable marked for redemption and nearing expiry:\n• Retryable: ${retryableUrl}\n• Timeout: ${timeoutStr}\n→ Check why it hasn't been executed.`
69+
if (!isNearExpiry(timeoutRaw)) continue
70+
message = `🚨 Retryable marked for redemption and nearing expiry:\n• Retryable: ${retryableUrl}\n• Timeout: ${timeoutStr}\n• Parent Tx: ${parentTx}\n• Deposit: ${deposit}\n→ Check why it hasn't been executed.`
6971
} else {
70-
continue // skip unexpected decisions
72+
continue
7173
}
7274

7375
await postSlackMessage({ message })

0 commit comments

Comments
 (0)