projectInvites holds the invitations that a project owner sends from the share dialog. One document is one invite to one email address. It is deleted when the invite is accepted or revoked, or by Mongo when it expires. The schema is services/web/app/src/models/ProjectInvite.mjs, and services/web/app/src/Features/Collaborators/CollaboratorsInviteHandler.mjs writes it.
An invite does not make anyone a member. Members are in the *_refs arrays of a project, see Projects Collection.
Fields
Who Writes It
Who Reads It
Indexes
Migrations are in
tools/migrations/. The schema also declares the expires TTL index, but Mongoose autoIndex is off (services/web/app/src/infrastructure/Mongoose.mjs:7), so the migration creates it.
Notes
- If the project has no editor slot left when a
readAndWriteorreviewinvite is accepted, the user joins as read-only and is listed inpendingEditor_refsorpendingReviewer_refsof the project (CollaboratorsInviteHandler.mjs:162-205). - Older invites stored the plain token in a
tokenfield. Migration20240524135408_add_token_hmac_project_invite_tokens.mjsaddedtokenHmacand20240531082910_remove_project_invite_tokens.mjsremovedtoken. - Nothing deletes the invites of a deleted project; they stay until the TTL index removes them.

