Skip to content

fix(server): hub moderation persistence, schema migrator, and hardening - #122

Open
Cod-e-Codes wants to merge 11 commits into
mainfrom
fix/hub-schema-moderation
Open

fix(server): hub moderation persistence, schema migrator, and hardening#122
Cod-e-Codes wants to merge 11 commits into
mainfrom
fix/hub-schema-moderation

Conversation

@Cod-e-Codes

@Cod-e-Codes Cod-e-Codes commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Persist permanent bans and unexpired temp kicks across hub restart (ban_history.expires_at)
  • Split readPump into typed dispatch handlers
  • Versioned MigrateSchema with hard-fail verification; SQLite/Postgres transactional per version; MySQL documented as non-wrapping (DDL implicit commit)
  • Drop the 100-year permanent-ban sentinel; O(1) username lookup; Hub mutex rules docs
  • Pin golangci-lint v2.12.2 and govulncheck v1.6.0; .golangci.yml (v2)
  • Review follow-up: close-before-insert (one open row), DB-authoritative ban/kick, latest-open-row load, mid-migration rollback test

Eleven sequential commits (do not squash).

Test plan

  • go test ./... and go test -race ./... locally
  • Nested plugin/sdk tests
  • Ban/kick persist + kick-then-ban single open row + latest-row load tests
  • Migration empty + incomplete-schema verification + injected mid-migration rollback (SQLite)
  • Dispatch malformed fall-through cases (nil reaction, empty recipient/channel)
  • CI build + database-smoke (Postgres/MySQL)

ARCHITECTURE still pointed at CreateSchema in handlers.go and omitted
ban_history.expires_at / schema_version; TESTING still suggested @latest.
Close open rows before insert, persist before updating in-memory maps, and
load the latest open row by id so kick-then-ban and legacy duplicates restart
cleanly.
SQLite and Postgres apply each version inside a transaction with rollback on
mid-migration failure; MySQL DDL implicitly commits so it stays non-wrapping
with schema_version recorded only after a successful apply.
@Cod-e-Codes Cod-e-Codes added documentation Improvements or additions to documentation enhancement New feature or request go Pull requests that update go code labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant