-
Notifications
You must be signed in to change notification settings - Fork 4
DELETE /conversation/{conversationId} does not delete the conversation #257
Comments
See also: #95 |
The DELETE operation does mark the conversation as deleted AND deletes all messages. The conversation and its metadata are preserved as those information are required for cloud-sync of the embedded Solr Servers managed by the different Smarti instances. For clean up one could run a Mongo task that physically deletes all conversations that where marked as deleted for longer as a given time period (e.g. 1 day). NOTES:
|
Hi @westei, thanks for investigating on this issue and fixing the PR. I like the idea using a configureable time period to run a clean up process for obsolete conversations. I noticed that deleting conversations (and analysis) on MongoDB results in Solr responses that have a IMOH we should create a separate issue about "Smarti housekeeping". |
This could be the case If the conversations in the Response are actually loaded from the MongoDB (based on the ID in the SolrIndex) and NOT reconstructured from the data in the SolrIndex. I will check if this is the case, because it could also explain why sometimes the numFound does not correspond with the number of actual results
This is part of #222 |
The ConversationSearchService loads Conversations and Messages from the MongoDB. In case a Conversation present in the SolrIndex is missing in the MongoDB the following Log message is written on IINFO level
Solr Results for those conversations are removed. So the number of Results will therefore differ from the |
We can configure Mongo to delete conversations that are maked as deleted automatically after a predefined period see https://docs.mongodb.com/manual/core/index-ttl/ |
will move this to |
Expected Behaviour
I use the API to delete an existing conversation from Smarti.
The conversation still exists in the database and the
GET /legacy/rocket.chat
still returns the deleted conversation with a 200 Code.On the other hand
GET /conversation/{conversationId}
can't find the conversation anymore and returns a 400 Code.Actual Behaviour
DELETE /conversation/{conversationId}
should delete the conversation from the databaseSteps to Reproduce
POST /conversation
GET /legacy/rocket.chat
returns the conversation for the specified channelIdGET /conversation/{conversationId}
returns the conversation for the specified conversationIdDELETE /conversation/{conversationId}
returns success for deletion 204GET /conversation/{conversationId}
returns 404 conversation not foundGET /legacy/rocket.chat
still returns the conversation for the specified channelIdDELETE /conversation/{conversationId}
returns 404 conversation not foundEnvironment
Smarti version 0.7.4-SNAPSHOT
CommitId: d4db0ea
The text was updated successfully, but these errors were encountered: