Skip to content

RAS-1878 Scheduled job to delete conversations marked for deletion#468

Open
LJBabbage wants to merge 5 commits intomainfrom
close_conversation_deletion
Open

RAS-1878 Scheduled job to delete conversations marked for deletion#468
LJBabbage wants to merge 5 commits intomainfrom
close_conversation_deletion

Conversation

@LJBabbage
Copy link
Copy Markdown
Contributor

@LJBabbage LJBabbage commented Apr 24, 2026

What and why?

Creates an end point and endpoint to delete conversations (and related secure messages/statuses) that have been marke_for_deletion

How to test?

Deploy this branch and helm chart (-p Deploy Version and Helm Chart ) then create a number of secure messages and responses, with at least one closed. For completeness I used both cron jobs sm-closed-conversations-mark-for-deletion and sm-closed-conversations-deletion. I changed the dates in the db of when conversations were closed and ran the former to change the mark_for_deletion status and the later to then delete.

N.B There is still a gap which we need to discuss in a tech session. It's feasible a conversation could be re-opened in the 23 hours it has been marked for deletion and therefore should not be deleted. There is a number of ways we might want to tackle that

Jira

@LJBabbage LJBabbage requested a review from a team as a code owner April 24, 2026 11:28
closedConversationsMarkForDeletionScheduler:
name: sm-closed-conversations-mark-for-deletion
cron: "0 0 * * *"
cron: "0 1 * * *"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Marked for deleted at 01:00 and then deleted 23 hours later at 00:00

- /bin/sh
- -c
- curl -s -u $(SECURITY_USER_NAME):$(SECURITY_USER_PASSWORD) -X POST http://$(SECURE_MESSAGE_SERVICE_HOST):$(SECURE_MESSAGE_SERVICE_PORT)/$(TARGET)
- curl -s -u $(SECURITY_USER_NAME):$(SECURITY_USER_PASSWORD) -X POST http://$(SECURE_MESSAGE_SERVICE_HOST):$(SECURE_MESSAGE_SERVICE_PORT)$(TARGET)
Copy link
Copy Markdown
Contributor Author

@LJBabbage LJBabbage Apr 24, 2026

Choose a reason for hiding this comment

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

Noticed the double "/" as the value file already has it

return "", 500


class ThreadDeletion(Resource):
Copy link
Copy Markdown
Contributor Author

@LJBabbage LJBabbage Apr 24, 2026

Choose a reason for hiding this comment

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

At some stage this thread/conversation muddle needs correcting, but continued it for now

and "health" not in request.endpoint
and request.endpoint != "info"
and request.endpoint != "threadmarkfordeletion"
and request.endpoint != "threaddeletion"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As agreed in tech, this doesn't need JWT

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants