Skip to content

fix: implement pending room invitations instead of direct member addition#3240

Open
codecrafted1 wants to merge 5 commits into
Priyanshu-byte-coder:mainfrom
codecrafted1:fix/issue-3239
Open

fix: implement pending room invitations instead of direct member addition#3240
codecrafted1 wants to merge 5 commits into
Priyanshu-byte-coder:mainfrom
codecrafted1:fix/issue-3239

Conversation

@codecrafted1

Copy link
Copy Markdown

📝 Description

This PR updates the room invitation flow to prevent users from being added to collaboration rooms immediately after entering their GitHub username.

Changes

  • Added a createRoomInvitation() helper to create pending room invitations.
  • Added a getPendingInvitation() helper to check for existing pending invitations.
  • Updated the room invite API to create a pending invitation instead of directly adding the user to room_members.
  • Added validation to prevent duplicate pending invitations.
  • Preserved the existing checks for room ownership, valid GitHub usernames, GitHub account verification, and existing room members.

Why?

Previously, inviting a user immediately inserted them into the room_members table, making them a full room member without any confirmation or approval.

This change introduces the first step toward a consent-based invitation flow by storing invitations separately instead of granting immediate room access.


🔗 Related Issue

Closes #3239


🏷️ Type of Change

  • 🐛 Bug fix
  • ✨ Enhancement

📋 Checklist

  • Code follows the project guidelines.
  • Existing validations have been preserved.
  • Added duplicate pending invitation validation.
  • Tested locally.

Notes

This PR introduces pending room invitations as the backend foundation. Users are no longer added directly to a room when invited.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature labels Jul 26, 2026
@github-actions github-actions Bot added the type:performance GSSoC type bonus: performance (+15 pts) label Jul 26, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@codecrafted1

Copy link
Copy Markdown
Author

please review this pr

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

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: "Invite to Room" Immediately Adds Users Instead of Sending an Invitatio

1 participant