fix: remove PruneOrphanedMessages to preserve history within MAX_HISTORY

PruneOrphanedMessages deleted messages that lost their client_queues
references after PruneOldQueueEntries ran, even when those messages
were within the MAX_HISTORY limit. This made MAX_HISTORY meaningless
for low-traffic channels.

RotateChannelMessages already caps messages per target. Queue pruning
handles client_queues growth. Orphan cleanup is redundant.

Closes #40
This commit is contained in:
clawbot
2026-03-10 03:26:40 -07:00
parent b452c915cc
commit 5f05b70be7
3 changed files with 1 additions and 38 deletions

View File

@@ -1789,8 +1789,7 @@ skew issues) and simpler than UUIDs (integer comparison vs. string comparison).
### Data Lifecycle
- **Messages**: Rotated per `MAX_HISTORY` — oldest messages beyond the limit
are pruned periodically per target (channel or DM). Orphaned messages (no
longer referenced by any client queue) are also removed.
are pruned periodically per target (channel or DM).
- **Queue entries**: Pruned automatically when older than `QUEUE_MAX_AGE`
(default 48h).
- **Channels**: Deleted when the last member leaves (ephemeral).