Page MenuHomePhabricator

[lib] Add a new endpoint for deleting messages
Needs RevisionPublic

Authored by tomek on Thu, Apr 3, 8:21 AM.

Details

Reviewers
kamil
ashoat
Summary

This more or less follows what we're doing for message editing. The only significant change is the permissions check.

https://linear.app/comm/issue/ENG-10339/create-the-logic-that-supports-deleting-the-messages-inserting-them

Depends on D14511

Test Plan

Tested later in the stack by deleting a message and noticing that it gets deleted on two clients.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Thu, Apr 3, 8:40 AM
ashoat requested changes to this revision.Thu, Apr 3, 8:38 PM
ashoat added inline comments.
keyserver/src/responders/message-responders.js
451–460

We are issuing the exact same query here twice at the same time. Can this be avoided?

470

This comment is a bit confusing... you suggest that the client should send the ID of the sourceMessage instead, but the check seems to indicate that is exactly what the client did (it sent targetMessageThreadInfo.sourceMessageID, right?)

482

Should we add another check here to prevent the client from deleting a sidebarCreation message? Context here

497–503

What is the effect of deleting the SIDEBAR_SOURCE message like this? Should it be allowed?

This revision now requires changes to proceed.Thu, Apr 3, 8:38 PM