Skip to content

Fix: [AEA-6533] - Handle Modification of User Messages#547

Open
kieran-wilkinson-4 wants to merge 13 commits intomainfrom
AEA-6533-Message-Edit-Issue
Open

Fix: [AEA-6533] - Handle Modification of User Messages#547
kieran-wilkinson-4 wants to merge 13 commits intomainfrom
AEA-6533-Message-Edit-Issue

Conversation

@kieran-wilkinson-4
Copy link
Copy Markdown
Contributor

@kieran-wilkinson-4 kieran-wilkinson-4 commented Apr 22, 2026

Summary

Handles users modifying messages

Details

  1. If user modifies a message that has no later messages in the chain
    • The bot response to the message is modified
    • The old message is remove
  2. If the user modified a message that has later messages
  • The bot doesn't change any responses
  • No messages are modified or deleted
  • The bot posts an ephemeral message, only visible to the user

Examples:

Changing message without any follow up messages

Original:
image

Modified:

Only seemed to respond to the edit if I tagged @dev-eps-assist-me

image
Changing message with follow up messages

Original:
image

Modified:

Only seemed to respond to the edit if I tagged @dev-eps-assist-me

image

@kieran-wilkinson-4 kieran-wilkinson-4 force-pushed the AEA-6533-Message-Edit-Issue branch from c51b208 to a6268f3 Compare April 22, 2026 14:37
@kieran-wilkinson-4 kieran-wilkinson-4 changed the title chore: Prep PR Fix: [AEA-6533] - Handle Modification of User Messages Apr 23, 2026
Comment on lines +558 to +561
has_user_replies = any(msg.get("user") == user_id for msg in subsequent_messages)

if has_user_replies:
_notify_diverged_conversation(client, channel, user_id, thread_ts, event_id)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question:

is there a potential race condition between the has_user_replies check and the subsequent message deletion loop?

if a user posts a reply in that window, could their message be silently deleted with no ephemeral warning, would it be worth re-checking for user messages inside the deletion loop before each delete?

Copy link
Copy Markdown
Contributor Author

@kieran-wilkinson-4 kieran-wilkinson-4 Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user messages can't be deleted by the bot (it doesn't have permission) - though, we don't even need a loop because we only delete the last message 🤷‍♀️

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants