Repository navigation
Conversation
Polling Redis instead of Postgress on getresult
SubmitCode never checked attempt/purchase status before enqueueing a submission to Judge0, unlike submitVisualSolution (Round 1) which already gates on GetAttemptForUpdate + status "available" -> 403. This meant a user could call POST /submit directly, skip POST /attempts/:id entirely, and still collect the full reward on a correct submission: EnsureAttempt silently backfills an unpaid "bought" attempt row at result-finalize time in finalizeSubmission, and the reward payout only checks attempt.Status != "answered", not whether the buy-in was ever paid. Adds a plain (non-locking) GetAttempt query mirroring GetAttemptForUpdate's shape, and checks it in SubmitCode before any Judge0 work happens: no attempt row, or a row still in "available", now returns 403 "Question not purchased -- buy this question before submitting", matching the exact wording and status code submit_round1.go already uses for the same concept. The decision itself is extracted into attemptAllowsSubmission(status string) bool so it's unit-testable without a database connection. Verified: go build, go vet, golangci-lint (0 issues), go test ./... all pass. database/queries/attempts.sql + internal/db/sqlc/* were regenerated via `sqlc generate` (v1.31.1, matching go.mod) -- not hand-edited.
…-attempt fix(submission): reject code submissions for unpurchased questions
Google login previously matched users strictly by google_id, so accounts seeded ahead of the event (email/reg_no/role only, no google_id) always failed with 'Account is not registered' on first sign-in. findUser now falls back to a lookup by verified email when no google_id match exists, and claims the account by setting google_id (guarded by 'WHERE google_id IS NULL' to prevent re-linking/takeover of an already-claimed account). Adds GetUserByEmail and LinkGoogleID sqlc queries.
- multi-target Dockerfile (api/worker/migrate), non-root - docker-compose: add migrate + worker services, health gating - docker-compose.dev.yml: hot-reload overlay - fix Dockerfile.dev (missing air install, pin air for go1.25, git safe.directory) - rewrite Makefile with .PHONY, worker/migrate/dev/clean targets - drop MAKEFILE_COMMANDS.md, fold into README
…ogin fix: link google_id on first login for pre-seeded accounts
chore: make Docker/Makefile setup prod-ready
Issue 57, 58 fixed GetResult timeout issue
feat: Implemented the partial scoring system
…und-control feat(admin): implement admin dashboard and round control engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.