Skip to content

Conversation

@kulkarnigaurav38
Copy link

@kulkarnigaurav38 kulkarnigaurav38 commented Mar 11, 2022

Proposed changes (including videos or screenshots)

Added a new delete method on the messages bridge for deleting messages via the Apps-Engine.

Issue(s)

References the PR in Rocket.Chat.Apps-Engine repo : Link

Steps to test or reproduce

Further comments


protected async delete(messageId: string, appId: string): Promise<void> {
this.orch.debugLog(`The App ${appId} is deleting a message.`);
Messages.removeById(messageId);
Copy link
Contributor

@murtaza98 murtaza98 Mar 16, 2022

Choose a reason for hiding this comment

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

We shouldn't delete the database entry directly from here. There are a couple of checks that need to be performed, also some hooks that need to be called, before we actually delete a message from DB. You can take a look at this file to understand more about this: app/lib/server/functions/deleteMessage.ts.

Copy link
Member

@d-gubert d-gubert left a comment

Choose a reason for hiding this comment

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

The change mentioned by @murtaza98 needs to be applied

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants