From e9455e0d1c59bbeafdd6d710156783c91dacec9d Mon Sep 17 00:00:00 2001 From: Mish Date: Sun, 14 Dec 2025 00:06:14 +0000 Subject: [PATCH] Fix the alaninnovates bug (#134) * Add a little log * Ensure closed tickets are attributed to helpers correctly * Add a success log when a ticket is resolved --- nephthys/actions/resolve.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nephthys/actions/resolve.py b/nephthys/actions/resolve.py index e5ffcab..5052f9e 100644 --- a/nephthys/actions/resolve.py +++ b/nephthys/actions/resolve.py @@ -37,9 +37,13 @@ async def resolve( ) return ticket = await env.db.ticket.find_first( - where={"msgTs": ts, "NOT": [{"status": TicketStatus.CLOSED}]} + where={"msgTs": ts, "NOT": [{"status": TicketStatus.CLOSED}]}, + include={"assignedTo": True}, ) if not ticket: + logging.warning( + f"Failed to resolve ticket ts={ts} because it's already closed or doesn't exist." + ) return if not resolving_user.helper and ticket.assignedTo: @@ -100,3 +104,5 @@ async def resolve( await delete_message( channel_id=env.slack_ticket_channel, message_ts=tkt.ticketTs ) + + logging.info(f"Resolved ticket ts={ts} resolving_user={resolving_user.slackId}")