Repository navigation
Conversation
📝 WalkthroughWalkthroughEndpoint initialization is consolidated to occur in Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Serverpod
participant Server
participant Endpoints
Note over Client,Endpoints: Old Flow (Before)
Client->>Serverpod: new Serverpod()
Serverpod->>Endpoints: initializeEndpoints(server)
Serverpod->>Serverpod: _configureInsightsServer()
Serverpod->>Endpoints: initializeEndpoints(insightsServer)
Client->>Server: start()
Server->>Endpoints: initializeEndpoints(this)
Note over Client,Endpoints: New Flow (After)
Client->>Serverpod: new Serverpod()
Note over Serverpod: No endpoint initialization
Client->>Server: start()
Server->>Endpoints: try: initializeEndpoints(this)
alt initialization succeeds
Endpoints-->>Server: success
else initialization fails
Endpoints-->>Server: exception
Server->>Server: report framework error
Server-->>Client: false
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
This PR needs to be complemented with lazy endpoint initialization in the test framework. |
|
@coderabbitai We will not implement this feature right now since it is not critical. Please log an issue for this. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@SandPod: I'll create a GitHub issue to track this follow-up work. 🏁 Script executed: Length of output: 88 Let me retry that with the repository context: 🏁 Script executed: Length of output: 50 @SandPod: I've created issue #4146 to track the lazy endpoint initialization in the test framework. The issue has been assigned to you and includes a reference back to this PR. Issue: #4146 🧠 Learnings used |
Moves the initialize call for endpoint from the Serverpod constructor to the server start sequence.
This enables adding dependencies on global state to be configured before the endpoint is constructed.
This will be used in the new auth modules to ensure that AuthConfig is initialized before the endpoint is initialized, enabling us to throw an exception when the server is started with invalid configuration.
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.If you need help, consider asking for advice on the discussion board.
Breaking changes
We don't give a guarantee today when the endpoint is initialized, so this should not be something that users are depending on.
Summary by CodeRabbit
Bug Fixes
Refactor