Full-stack message edit/delete with audit trail, a multi-service backup pipeline with the most enthusiastic theming Jenkins has ever seen, and a DM history bug that was quietly deleting conversations every time someone closed a chat.
Message Edit & Delete with Audit Trail
Added the full edit/delete lifecycle across all layers. New MessageEdit model in Prisma snapshots old content via $transaction before each edit. Deletes are soft—content is wiped but the tombstone stays, tagged with isDeleted, deletedAt, and deletedBy. The REST API got three new endpoints (PUT for edit, GET for history, updated DELETE for soft-delete), and both message_edited and message_deleted WS events broadcast in real time. On the frontend: inline edit mode with a textarea, "(edited)" labels that open a decrypted version history modal, delete confirmation dialog, and moderator permission checks so admins can delete anyone's messages. All optimistic updates in Zustand with rollback on failure.
Backup Manager (BM)
What started as "let's set up local pg_dump backups" turned into a full multi-service backup framework. A central config file defines services, containers, and credentials. The backup script handles retention tiers (7 daily, 4 weekly, 12 monthly), with safety limits: 500 MB max per dump, 2 GB cap per service, and 1 GB minimum free disk. The integrity verifier restores to a temp database and compares row counts per table against live. The Jenkins pipeline ties it all together—daily dumps at 3 AM, full deep inspection on Sundays. First successful build: all 16 tables verified, 1.42 MB across 6 daily and 2 weekly dumps. The pipeline has a theme. It involves poop emojis.
The DM History Bug
Discovered that closing a DM conversation was permanently orphaning message history. The closeDm method was deleting the user's RoomMember record, so reopening the same DM created an entirely new room—new room key, no messages. The fix: added an isHidden field to RoomMember. Close now sets the flag instead of deleting, getUserDms filters hidden entries, and getOrCreateDmRoom un-hides existing rooms on reopen. Same room, same key, full history preserved.
Jenkins Pipeline Debugging
Registering the BM pipeline in Jenkins surfaced two environment issues. First, Windows backslash paths in Groovy environment blocks get eaten when passed to Git Bash via -c—solved with a separate BM_DIR_UNIX variable using forward slashes. Second, the Jenkins agent's PowerShell didn't support Get-Content -AsByteStream—replaced with docker cp to pipe dump files into the container for pg_restore --list verification. Build #2 came back green.
What's Next
- Apply pending migrations to dev and prod databases (
prisma migrate deploy) - Clean up old backup location
- Add more services to
services.confas they come online (Enclave, etc.) - Merge enhancements branch to master when ready for production deploy