feat(core): add message delete endpoint#14417
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
204d23c to
bcc4c3c
Compare
| .from(MessageTable) | ||
| .where(and(eq(MessageTable.id, input.messageID), eq(MessageTable.session_id, input.sessionID))) | ||
| .get() | ||
| if (!row) throw new NotFoundError({ message: `Message not found: ${input.messageID}` }) |
There was a problem hiding this comment.
Why was this changed? the delete won't error, is there a use case you have for making this error? we don't have this pattern anywhere else in session
There was a problem hiding this comment.
The API could delete message that didn't belong to session by providing a message id from different session
There was a problem hiding this comment.
I think you're right to fix that, but I think it's good enough to add the session_id to the where clause. We don't check and error like this in any of the other APIs, can you change that?
Can you also add session_id to the where clause in removePart too?
bcc4c3c to
8a2a43f
Compare
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Issue for this PR
New feature, no issue
Type of change
What does this PR do?
Implements a new endpoint to delete a message
If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.