Skip to content

Chat lifecycle: archive, 6-month cleanup, restore, delete, deleted Users #98

Closed

Description

@Oceandek

Parent

#91

What to build

  • Archiving: projects.archived_at records when a Project was archived. Its chat becomes read-only, and only Teachers and the Superuser can still read it; Members, Makers and Guests lose access. The chat shows "This chat will be deleted on " (6 months after archiving).
  • Cleanup: once a day, the backend's background loop deletes the messages and files of chats of Projects archived more than 6 months ago.
  • Restore within 6 months: the chat becomes writable again, with its history. After the cleanup, it starts empty.
  • Deleting a Project deletes its chat and files at once.
  • Deleting a User is no longer refused because of chat messages; their messages stay, shown as "Deleted user". A deactivated User's messages stay under their name.

Spec stories 36-41.

Acceptance criteria

  • Migration: projects.archived_at (backfilled with now() for already Archived Projects)
  • Archived chats refuse sending, editing, reacting, typing and Guests (409); Students and Guests get 403
  • Cleanup job + test with a moved clock; files removed from the volume
  • Delete Project removes chat files; delete User keeps messages as "Deleted user"
  • Frontend: read-only chat with the deletion notice
  • API tests; NiceGUI test of the read-only archived chat

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions