Skip to content

fix(task): check group membership via subquery - #247

Merged
BobAnkh merged 3 commits into
devfrom
fix-submit-ambiguous-id
Oct 20, 2026
Merged

BobAnkh merged 3 commits into
devfrom
fix-submit-ambiguous-id

Conversation

@un-lock-able

Copy link
Copy Markdown

Every POST /tasks without a suite_uuid returns 500 on dev with column reference "id" is ambiguous.

internal_submit_task checks group membership and bumps the group's task counter in one UPDATE, joining user_group in its FROM. sea-orm's exec_with_returning emits an unqualified RETURNING "id", …, and with both group and user_group in scope Postgres rejects "id" as ambiguous.

Membership is now checked with group.id IN (SELECT group_id FROM user_group WHERE user_id = $1), so group is the only table in the statement. The authorization rule, the 404 on a miss and the single-statement atomicity are unchanged. Submissions with a suite were never affected: that path resolves the suite with a separate, column-qualified SELECT.

Comment thread netmito/src/service/task.rs Outdated
@un-lock-able
un-lock-able requested a review from BobAnkh October 20, 2026 03:08
@BobAnkh BobAnkh changed the title fix(task): resolve group membership via subquery on submit fix(task): check group membership via subquery Oct 20, 2026
@BobAnkh
BobAnkh merged commit 926d8dc into dev Oct 20, 2026
11 checks passed
@BobAnkh
BobAnkh deleted the fix-submit-ambiguous-id branch October 20, 2026 07:49
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.

2 participants