Skip to content

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

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

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 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

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Heads up: this overlaps #3269, which implements the same pending-room-invitations feature (invitations API, PendingInvitations UI, and a room_invitations migration). I don't want two implementations of the same flow landing.

I'll review both and pick one — if you think yours covers something #3269 doesn't, say so here and I'll weigh that. Note CI is currently red on this branch (Type check + Build fail), so it needs fixing either way.

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Closing in favor of #3269, which has now been merged. Both PRs implemented pending room invitations; #3269 is the more complete version — it ships the migration and schema update, the types, both API routes, and the UI (PendingInvitations, updated InviteModal/MembersPanel), and its full CI suite is green including the Playwright run.

This branch covers 4 files with no UI layer, and CI is currently red here (Type check, Build and Playwright all fail). Thanks for tackling the same bug — the invite-without-consent issue is fixed on main now.

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

Labels

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

2 participants