fix(invitations): break outbox import cycle - #6969
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The workspace-added email event type and payload now live in a dependency-free Invitation acceptance still activates the org on the current session, but loads Reviewed by Cursor Bugbot for commit 522874b. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR breaks an invitation/outbox initialization cycle by extracting the direct-grant email event contract and deferring the auth-dependent organization activation import.
Confidence Score: 5/5The PR appears safe to merge with no concrete correctness, security, or build failures identified. The moved exports have no stale consumers, the deferred import remains within the invitation route’s request scope, and the new boundary tests cover the static initialization relationship responsible for the cycle.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/invitations/core.ts | Replaces the static auth dependency with a request-scoped dynamic import while preserving post-commit activation and error handling. |
| apps/sim/lib/invitations/direct-grant-event.ts | Introduces a dependency-free module containing the unchanged direct-grant email event contract. |
| apps/sim/lib/invitations/direct-grant.ts | Imports the extracted event contract without changing direct-grant behavior or its remaining public exports. |
| apps/sim/lib/invitations/import-boundary.test.ts | Adds focused regression checks preventing direct grants from statically reaching auth initialization and keeping the event contract dependency-free. |
| apps/sim/lib/admin/invitation-operation.ts | Redirects event-contract imports to the new dependency-free module. |
| apps/sim/lib/billing/enterprise-provisioning.ts | Redirects the direct-grant event-type import to the extracted contract module. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Outbox[Outbox processor] --> Grant[direct-grant.ts]
Grant --> Core[invitations/core.ts]
Grant --> Event[direct-grant-event.ts]
Core -. deferred import .-> ActiveOrg[auth/active-organization.ts]
ActiveOrg --> Auth[auth/auth.ts]
Event -. dependency-free contract .-> Admin[Admin invitation operations]
Event -. dependency-free contract .-> Billing[Enterprise provisioning]
Reviews (1): Last reviewed commit: "fix(invitations): break outbox import cy..." | Re-trigger Greptile
Summary
Type of Change
Testing
Checklist