Skip to content

fix(help): enforce recommendation ownership check on sendHelpRequest #804

Open
Shriraj888 wants to merge 1 commit into
Coder-s-OG-s:mainfrom
Shriraj888:fix/send-help-request-ownership-check
Open

fix(help): enforce recommendation ownership check on sendHelpRequest #804
Shriraj888 wants to merge 1 commit into
Coder-s-OG-s:mainfrom
Shriraj888:fix/send-help-request-ownership-check

Conversation

@Shriraj888

Copy link
Copy Markdown

Summary

Enforces recommendation ownership in sendHelpRequest before allowing contributors to create a help request or trigger Inngest help dispatch notifications.

Type of Change

  • Bug fix
  • New feature
  • UI / UX improvement
  • Refactor
  • Documentation
  • Other

Related Issue

Closes #794

What was changed?

  • Added recommendation lookup using service role client in sendHelpRequest (src/app/actions/help.ts) prior to processing cooldown and insert.
  • Rejected requests with not_found if recommendation does not exist, and forbidden if it does not belong to the signed-in user (rec.user_id !== user.id).
  • Persisted recommendation_id on the help_requests insert row for triage traceability back to the recommended work.
  • Added unit tests in src/app/actions/help.test.ts covering missing, foreign, and owned recId scenarios.

Screenshots

N/A (Backend API / Server Action update)

Checklist

  • My code follows the project structure and conventions
  • I tested this locally (npm run dev)
  • No hardcoded secrets or credentials
  • I have updated documentation if needed

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

@Shriraj888 is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Shriraj888 Shriraj888 changed the title fix(help): enforce recommendation ownership check on sendHelpRequest (#794) fix(help): enforce recommendation ownership check on sendHelpRequest Jul 25, 2026
@Shriraj888

Copy link
Copy Markdown
Author

@Ayush4958 Could you please review this PR when you get a chance? Thanks !

@pavsoss pavsoss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sendHelpRequest accepts any recId without ownership check

2 participants