Starting to reply to a message while the chat history is cleared gives unexpected behaviour
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.2k
- Forks
- 587
- Avg merge
- 18h 27m
- Merged PRs (30d)
- 333
Description
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
Scenario: Starting to reply to a message while the chat history is cleared
Given user "participant1" creates room "room" (v4)
| roomType | 3 |
| roomName | room |
And user "participant1" sends message "Message 1" to room "room" with 201
And user "participant1" deletes chat history for room "room" with 200
And user "participant1" sends reply "Message 1-1" on message "Message 1" to room "room" with 201
The problem:
And user "participant1" sends reply "Message 1-1" on message "Message 1" to room "room" with 201 # FeatureContext::userSendsReplyToRoom()
{"ocs":{"meta":{"status":"failure","statuscode":400,"message":""},"data":[]}}
Failed asserting that 400 matches expected 201.
The suggested step to solve:
And user "participant1" sends reply "Message 1-1" on message "Message 1" to room "room" with 400
"""
{
"type": "error",
"error": {
"code": "invalid_parent_message",
"message": "The parent message do not exists anymore."
}
}
"""
Also tagging https://github.com/nextcloud/spreed/labels/feature%3A%20api%20%F0%9F%9B%A0%EF%B8%8F , as there is a chance that the message expires exactly while you post, which will result in a "default" 400 Bad Request.
Maybe we should add a message there on the return which can then be shown in the UIs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Gherkin scenario and the FeatureContext::userSendsReplyToRoom() step referenced in the failure. Trace the API handling for replies after chat history deletion, then verify that an expired or deleted parent returns HTTP 400 with the invalid_parent_message error instead of the generic response.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100