Skip to content

fix: comments 404 on VideoDetail — invalid SQL alias#117

Merged
alexneamtu merged 1 commit intomainfrom
fix/comments-query-alias
Mar 19, 2026
Merged

fix: comments 404 on VideoDetail — invalid SQL alias#117
alexneamtu merged 1 commit intomainfrom
fix/comments-query-alias

Conversation

@alexneamtu
Copy link
Contributor

Summary

  • ListOwnerComments query used v.user_id and v.comment_mode but the table wasn't aliased as v
  • PostgreSQL threw missing FROM-clause entry for table "v", caught as generic error → 404
  • This broke the comments section on VideoDetail for all users, all videos
  • Found via production logs from MARAMM (first paying customer)

Test plan

  • TestListOwnerComments_ReturnsAllComments — updated mock, passes
  • TestListOwnerComments_NotOwner_Returns404 — passes
  • Full go test ./... — all packages pass

The query used `v.user_id` and `v.comment_mode` but the FROM clause
had no `v` alias, causing a PostgreSQL error that was caught as a
generic error and returned as 404. This broke the comments section
on VideoDetail for all users.
@github-actions
Copy link

Preview deployed: https://pr-117.app.sendrec.eu

@alexneamtu alexneamtu merged commit 754db2f into main Mar 19, 2026
4 checks passed
@alexneamtu alexneamtu deleted the fix/comments-query-alias branch March 19, 2026 16:10
@github-actions
Copy link

Preview environment cleaned up.

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