Skip to content

logging, unit testing, and rate limiting#121

Open
Owen-Isenhart wants to merge 8 commits intomainfrom
feat/log_test_limit
Open

logging, unit testing, and rate limiting#121
Owen-Isenhart wants to merge 8 commits intomainfrom
feat/log_test_limit

Conversation

@Owen-Isenhart
Copy link
Contributor

do not fear, 6k of these lines are just package-lock.json on server since i guess npm install was never run on it. and the rest are pretty simple changes that should not break anything (most are just unit tests and the others are logs and validation)

so, this adds and changes unit tests (since some were like 3k lines of garbage), and i made a makefile so instead of having to run everything one by one you can just run "make test" from the root, and it will test everything. there are more commands for if you just want to test the go files or just the server files or whatever, you can find those with "make help"

next, there's now structured logging throughout the backend (central service, rtc service, server), with log levels, context, tracking, and metadata. an example structure looks like this:
{
"timestamp": "2026-03-08T12:34:56.789Z",
"level": "INFO",
"service": "central-service",
"message": "Request processed",
"correlation_id": "req-123",
"user_id": "user-456",
"room_id": "room-789",
"status_code": 200,
"duration_ms": 45.23,
"metadata": {...}
}

last, we now have rate limiting so that ryan's server hopefully does not explode if someone gets stuck on two sum and tries to submit it 10k times within 20 seconds. thats about it, i think i also added some input validation stuff so we shouldn't be getting zipbombed n shit but yea.

@vercel
Copy link

vercel bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bsg Ready Ready Preview, Comment Mar 8, 2026 5:23pm

Request Review

@Owen-Isenhart Owen-Isenhart marked this pull request as ready for review March 9, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant