Prevent stale approval buttons
This commit is contained in:
@@ -460,10 +460,8 @@ INSERT INTO pending_approvals (
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 'pending')
|
||||
ON CONFLICT(telegram_user_id, codex_request_id) DO UPDATE SET
|
||||
payload_json = excluded.payload_json,
|
||||
message_chat_id = excluded.message_chat_id,
|
||||
message_id = excluded.message_id,
|
||||
status = 'pending',
|
||||
resolved_at = ''`,
|
||||
message_chat_id = CASE WHEN pending_approvals.status = 'pending' THEN excluded.message_chat_id ELSE pending_approvals.message_chat_id END,
|
||||
message_id = CASE WHEN pending_approvals.status = 'pending' THEN excluded.message_id ELSE pending_approvals.message_id END`,
|
||||
approval.TelegramUserID, approval.CodexRequestID, approval.CodexThreadID, approval.TurnID,
|
||||
approval.ItemID, approval.Kind, approval.PayloadJSON, approval.MessageChatID, approval.MessageID)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user