Trim comments to the non-obvious why
Test and deploy / test (push) Successful in 28s
Test and deploy / deploy (push) Successful in 31s

Drop narration, history and restated-code comments across the repo,
keep short ones for security boundaries, upstream quirks and ordering
constraints, and record the convention in CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-24 20:49:03 +00:00
co-authored by Claude Opus 5.5
parent effddd2794
commit 4530cb8dc4
222 changed files with 1173 additions and 5423 deletions
+3 -9
View File
@@ -12,21 +12,15 @@ import (
)
// AuthorID is the resolver for the authorId field.
// AuthorID is the resolver for the authorId field. The value is the chat
// hub's per-connection counter, not a User id — see models.Message.
// The chat hub's connection number, not a User id.
func (r *messageResolver) AuthorID(ctx context.Context, obj *models.Message) (int, error) {
return int(obj.AuthorID), nil
}
// Messages is the resolver for the messages field.
func (r *queryResolver) Messages(ctx context.Context) ([]*models.Message, error) {
// Non-admins get the public subset rather than an error, so the chat
// history loads for everyone. The same filter is applied to the history
// replayed over the WebSocket (services.HandleWebSocket) — change one and
// the other must change too.
//
// Note the ordering differs between the two: newest first here, oldest
// first over the socket.
// Non-admins get the public subset. Keep in step with the WebSocket
// history filter (services.HandleWebSocket), which is oldest first.
var messages []models.Message
query := r.Store.DB.Order("created_at DESC")
if !IsAdminFromCtx(ctx) {