Skip to content

Add collaborator list, leaving, resending, and the 10-person limit for shared folders - #457

Open
ksm0712 wants to merge 2 commits into
karan-shared-folders-invite-responsesfrom
karan-shared-folders-collaborators
Open

ksm0712 wants to merge 2 commits into
karan-shared-folders-invite-responsesfrom
karan-shared-folders-collaborators

Conversation

@ksm0712

@ksm0712 ksm0712 commented Nov 13, 2026 •

Copy link
Copy Markdown

Summary

Backend for the collaborator management screens in the Shared Folders Figma. The Share menu needs names and emails for everyone in a folder, members need a way to leave, and owners need to resend or cancel invites. Also caps folders at 10 collaborators and redesigns the invite email to match the Figma.

Part 1 of 7 of this week's Shared Folders work, stacked on #453. Merge order: #440, #452, #453, then:

  1. Collaborators backend (this PR)
  2. User search
  3. Sharing UI pieces
  4. Invite modal
  5. Share menu
  6. Invite page
  7. Real-time sync

Changes

  • GET /api/folders/:folderId/collaborators: owner and members with names and emails, plus pending invites (owner only) and the limit
  • DELETE /api/folders/:folderId/members/:memberId: a member can now pass their own ID to leave
  • POST /api/folders/:folderId/invites: re-inviting someone with a pending invite emails it again (200, resent: true) instead of returning 409. This also covers Bryan's note on Add folder invites by NetID with invite emails and rate limiting #452 that pending invites couldn't be resent.
  • 10-collaborator limit (members plus pending invites, owner not counted): new invites past it get 403 with the message from the Figma
  • DELETE /api/folder-invites/:inviteId: owner cancels a pending invite
  • Invite email redesigned per the Figma (2.1): folder card with "2 apartments · 3 people", OPEN FOLDER button, "This invitation was sent to ..."
  • getPeople helper in folderInvites.ts (one auth.getUsers call for the whole list), lastSentAt on FolderInvite
  • JSDoc on every new endpoint and helper

Design decisions

  • Names come from Firebase Auth, since folders only store user IDs. A deleted account still shows up with a placeholder name so the owner can remove it.
  • Members see who is in the folder but not pending invites, since only the owner can act on those.
  • Resending reuses the same invite, so the link in the first email keeps working.
  • The email uses inline styles and tables because most email apps strip style tags. The logo is text for now since we don't host an email logo image.

Screenshots

The invite email as received:

C1-01-invite-email-received

Backend tests passing:

C1-02-backend-tests-passing

Test Plan

Automated (Firebase and nodemailer mocked). From backend/: npx jest src/folderInvites.test.ts src/folderAccess.test.ts --forceExit

  • Email shows the folder size, OPEN FOLDER, and who it was sent to; still escapes HTML and links to the invite
  • Re-inviting a pending NetID resends the same invite and sets lastSentAt; a declined invite can be sent again
  • With 1 member and 9 pending invites, a new invite gets 403 and no email; answered invites don't count; resending still works at the limit
  • Owner can cancel a pending invite; members get 403; answered invites get 409; missing invites get 404
  • Collaborators: owner gets names, emails, and pending invites; members get the list without pending invites; others get 403; missing folder 404
  • A member can leave by removing themselves; members still can't remove other people
  • The rate limit test now spreads invites over two folders so the new collaborator limit isn't what stops them
Test Suites: 2 passed, 2 total
Tests:       43 passed, 43 total

All backend suites: 102 passed (server.test.ts needs the emulator). Prettier, ESLint (0 errors), and tsc pass.

Manual (localhost):

  • The Share menu (which uses GET /collaborators) shows my real name and email as owner, and the invited test user's after they accepted
  • Resending a pending invite returns 200 and shows the "Invite resent" message
  • A real invite email arrived in a real Cornell inbox (sent through my local Gmail app password, since the shared one is rejected on my machine)

Notes

Breaking Changes

  • POST /api/folders/:folderId/invites returns 200 with resent: true for a pending invite instead of 409. Nothing in the frontend used the old 409 yet.
  • buildInviteEmail and sendFolderInviteEmail now take one details object.

- GET /api/folders/:folderId/collaborators returns the owner and members with names and emails, plus pending invites for the owner
- Members can leave a folder by removing themselves
- Re-inviting someone with a pending invite emails it again instead of failing
- Folders are capped at 10 collaborators (members plus pending invites)
- DELETE /api/folder-invites/:inviteId lets the owner cancel a pending invite
- The invite email now matches the Figma design
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 1d2ddc9f-fa69-4d11-8210-fcee299ff3ed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dti-github-bot

Copy link
Copy Markdown
Member

[diff-counting] Significant lines: 425.

This branch has not been deployed

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