-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support editing/removing multipart Slack messages #782
Open
tadzik
wants to merge
9
commits into
matrix-org:develop
Choose a base branch
from
tadzik:tadzik/one-to-many-events
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This makes us the original sender's intent to redact messages, so that we do not require an elevated PL to handle message deletion.
…rmine a more fitting user
We may produce multiple Matrix events per Slack events, if the Slack events contains text with attachments. This should have been forbidden with a DB constraint, but for some reason it happened regardless. This updates the constraint to match reality, differentiating Matrix events by the type of incoming Slack event. For backwards compatibility reasons getEventBySlackId() returns the "main" Matrix event.
…zik/one-to-many-events
Messages with a message_changed will have the same `ts` as the original message, but a different `event_ts`. We now check both when considering whether or not to drop a message, and log our reasons regardless.
We now track which attachments was linked to which Matrix message, and support both removing them individually and dropping the whole event "tree".
tadzik
changed the title
Formalize our one-to-many relationship between Slack and Matrix events
Support editing/removing multipart Slack messages
Apr 5, 2024
Half-Shot
requested changes
Jun 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay, could do with a test?
Note: this is RTM-only, as webhooks do not support multipart messages in the first place. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We may produce multiple Matrix events per Slack events, if the Slack events contains text with attachments. This should have been forbidden with a DB constraint, but for some reason it happened regardless.
This updates the constraint to match reality, differentiating Matrix events by the type of incoming Slack event. For backwards compatibility reasons getEventBySlackId() returns the "main" Matrix event.
When handling message changes and message deletion, we will now correctly edit the right part of the message – either changing the text or removing some of the attachments (fixes #486). Deleting the whole message will now also remove all the attachments associated with it.
Depends on #780
Does not support NeDB, but I wonder if we want to support NeDB at all these days (ref #775)