跳轉到主要內容
projectInvites 儲存專案擁有者從共用對話框寄出的邀請。一份文件對應寄往一個電子郵件地址的一份邀請。邀請被接受或撤銷時,文件會被刪除;邀請過期時,Mongo 也會將其刪除。Schema 位於 services/web/app/src/models/ProjectInvite.mjs,由 services/web/app/src/Features/Collaborators/CollaboratorsInviteHandler.mjs 寫入。 邀請不會讓任何人成為成員。成員儲存在專案的 *_refs 陣列中,見 Projects 集合。

欄位

寫入方

讀取方

索引

遷移位於 tools/migrations/。Schema 也宣告了 expires 上的 TTL 索引,但 Mongoose 的 autoIndex 已關閉(services/web/app/src/infrastructure/Mongoose.mjs:7),因此由遷移建立該索引。

備註

  • 如果接受 readAndWrite 或 review 邀請時專案已沒有空餘的編輯者名額,使用者會以唯讀身分加入,並列在專案的 pendingEditor_refs 或 pendingReviewer_refs 中(CollaboratorsInviteHandler.mjs:162-205)。
  • 舊版邀請把明文權杖存放在 token 欄位中。遷移 20240524135408_add_token_hmac_project_invite_tokens.mjs 新增了 tokenHmac,20240531082910_remove_project_invite_tokens.mjs 移除了 token。
  • 沒有任何程式碼會刪除已刪除專案的邀請;它們會一直保留,直到被 TTL 索引移除。
最後修改於 2026年11月20日