Skip to content

chore: Update relic to 0.9.1 - #4125

Merged
nielsenko merged 3 commits into
serverpod:mainfrom
nielsenko:update-relic-0.9.0
Oct 30, 2025
Merged

nielsenko merged 3 commits into
serverpod:mainfrom
nielsenko:update-relic-0.9.0

Conversation

@nielsenko

@nielsenko nielsenko commented Oct 29, 2025 •

Copy link
Copy Markdown
Collaborator

Description

This PR updates Serverpod to use Relic 0.9.1.

  • Bumped relic from ^0.8.0 to ^0.9.1
  • Updated from NewContext to RequestContext throughout the codebase to align with Relic's new naming conventions
  • Changed RelicServer to use a factory function pattern (() => IOAdapter.bind(...)) instead of awaiting the adapter before creating the server
  • Removed the ServerInternalMethods extension and ioServer getter, replacing it with a public connectionsInfo() method
  • Changed from accessing ioServer.connectionsInfo() to using the new server.connectionsInfo() async method
  • Updated SessionEx extension to work on Context instead of RequestContext where appropriate

Fixes #?

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

Breaking changes

  • The ioServer getter is no longer available. Use server.connectionsInfo() instead to get connection information.
  • Internal code using NewContext must be updated to use RequestContext. This primarily affects custom routes and middleware implementations.

Summary by CodeRabbit

  • New Features

    • Added public connectionsInfo() method to monitor active server connections.
  • Chores

    • Updated relic dependency from ^0.8.0 to ^0.9.1 across all packages.
    • Refactored internal server architecture for improved modularity and maintainability.

@coderabbitai

coderabbitai Bot commented Oct 29, 2025 •

Copy link
Copy Markdown
Contributor

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.

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

📝 Walkthrough

Walkthrough

The PR migrates context parameter types from NewContext to RequestContext across request handlers and routes, upgrades the Relic dependency from ^0.8.0 to ^0.9.1, replaces direct HttpServer management with RelicServer's adapter pattern, adds a public connectionsInfo() API to the Server class, and removes internal ioServer exposure via the ServerInternalMethods extension.

Changes

Cohort / File(s) Summary
Relic Dependency Updates
packages/serverpod/pubspec.yaml, packages/serverpod_client/pubspec.yaml, templates/pubspecs/packages/serverpod/pubspec.yaml, templates/pubspecs/packages/serverpod_client/pubspec.yaml, templates/pubspecs/tests/serverpod_test_server/pubspec.yaml, tests/serverpod_test_server/pubspec.yaml
Updated relic dependency from ^0.8.0 to ^0.9.1 across all pubspec.yaml files.
Server Export API
packages/serverpod/lib/server.dart
Removed hide ServerInternalMethods clause from export, exposing the full public API of src/server/server.dart.
Server Core Refactoring
packages/serverpod/lib/src/server/server.dart
Replaced direct HttpServer binding with RelicServer using IOAdapter; removed _ioServer field and ServerInternalMethods extension; widened context types from NewContext to RequestContext; added public connectionsInfo() method.
Health Check
packages/serverpod/lib/src/server/health_check.dart
Changed from synchronous pod.server.ioServer?.connectionsInfo() to asynchronous await pod.server.connectionsInfo().
Web Server Routes
packages/serverpod/lib/src/web_server/web_server.dart, packages/serverpod/lib/src/web_server/routes/static_route.dart
Updated Route and WidgetRoute.handleCall signatures to accept RequestContext instead of NewContext; changed port retrieval from adapter to server.port; adjusted session extension from RequestContext to Context.
Test Utilities
packages/serverpod_client/test/test_utils/test_http_server.dart, packages/serverpod_client/test/test_utils/test_web_socket_server.dart
Updated request handler context types to RequestContext; changed RelicServer construction to use IOAdapter factory closure; updated port retrieval to use server.port.
Apple IDP Notification Routes
modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart, modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/routes/apple_server_notification_route.dart
Updated AppleRevokedNotificationRoute.handleCall and internal handlers to use RequestContext instead of NewContext.
Test Middleware
tests/serverpod_test_server/test/middleware_test.dart
Updated TestRoute.handleCall parameter from NewContext to RequestContext; changed session extension target from RequestContext to Context.

Sequence Diagram

sequenceDiagram
    participant Client
    participant RelicServer
    participant Route
    participant Handler

    alt Before (NewContext)
        Client->>RelicServer: HTTP Request
        RelicServer->>Route: call(NewContext)
        Route->>Handler: handleCall(Session, NewContext)
        Handler->>Route: Response
        Route->>Client: HTTP Response
    end

    alt After (RequestContext)
        Client->>RelicServer: HTTP Request
        Note over RelicServer: IOAdapter factory pattern
        RelicServer->>Route: call(RequestContext)
        Route->>Handler: handleCall(Session, RequestContext)
        Handler->>Route: Response
        Route->>Client: HTTP Response
    end

    Note over RelicServer: New: connectionsInfo() async API<br/>Removed: _ioServer / ServerInternalMethods
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Server architecture change: Replacing HttpServer with RelicServer adapter pattern requires careful review of binding logic, port retrieval, and shutdown paths.
  • Public API surface changes: Removal of ServerInternalMethods extension and addition of connectionsInfo() method affects public API contract.
  • Context type migration: While repetitive across files, verify that NewContext → RequestContext changes are complete and correct in all request paths (Apple IDP, test utilities, routing).
  • RelicServer initialization: Verify the lazy factory pattern (() => IOAdapter.bind(...)) is correctly integrated across test and production servers.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "chore: Update relic to 0.9.1" accurately describes a significant part of the changeset—the dependency upgrade that triggers these changes. However, the title does not fully capture the scope of the work, which includes substantial refactoring (NewContext to RequestContext throughout the codebase), breaking API changes (removal of ioServer getter, addition of connectionsInfo() method), and changes to RelicServer initialization patterns. A developer scanning the history would see this as a routine dependency bump rather than understanding it involves breaking changes and widespread code updates. The title is related to the main changes but remains somewhat narrow given the scope of refactoring and API updates involved.
Description Check ✅ Passed The PR description is mostly complete and well-structured, providing a clear explanation of changes, detailed pre-launch checklist responses, and a comprehensive breaking changes section. The description aligns with the template structure and includes substantive content across all major sections. However, one template requirement is not fulfilled: the author has left the issue reference as "Fixes #?" without providing an actual issue number, and the corresponding checklist item ("I listed at least one issue that this PR fixes") is unchecked. This indicates the author acknowledged but did not complete this requirement.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@nielsenko
nielsenko force-pushed the update-relic-0.9.0 branch 4 times, most recently from b20aa5e to 7c88dba Compare October 29, 2025 19:26
@nielsenko nielsenko changed the title chore: Update relic to 0.9.0 chore: Update relic to 0.9.1 Oct 30, 2025
@nielsenko

Copy link
Copy Markdown
Collaborator Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Oct 30, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

1 similar comment
@coderabbitai

coderabbitai Bot commented Oct 30, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e43f8b and 74ec505.

📒 Files selected for processing (16)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/routes/apple_server_notification_route.dart (1 hunks)
  • packages/serverpod/lib/server.dart (1 hunks)
  • packages/serverpod/lib/src/server/health_check.dart (1 hunks)
  • packages/serverpod/lib/src/server/server.dart (5 hunks)
  • packages/serverpod/lib/src/web_server/routes/static_route.dart (2 hunks)
  • packages/serverpod/lib/src/web_server/web_server.dart (4 hunks)
  • packages/serverpod/pubspec.yaml (1 hunks)
  • packages/serverpod_client/pubspec.yaml (1 hunks)
  • packages/serverpod_client/test/test_utils/test_http_server.dart (1 hunks)
  • packages/serverpod_client/test/test_utils/test_web_socket_server.dart (1 hunks)
  • templates/pubspecs/packages/serverpod/pubspec.yaml (1 hunks)
  • templates/pubspecs/packages/serverpod_client/pubspec.yaml (1 hunks)
  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml (1 hunks)
  • tests/serverpod_test_server/pubspec.yaml (1 hunks)
  • tests/serverpod_test_server/test/middleware_test.dart (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.dart

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.dart: Format all Dart code using dart format . before committing
Code must pass Dart analyzer in strict mode (util/run_tests_analyze or melos lint_strict)
Use descriptive variable and function names

Files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/routes/apple_server_notification_route.dart
  • packages/serverpod/lib/src/server/health_check.dart
  • tests/serverpod_test_server/test/middleware_test.dart
  • packages/serverpod/lib/server.dart
  • packages/serverpod/lib/src/web_server/routes/static_route.dart
  • packages/serverpod_client/test/test_utils/test_http_server.dart
  • packages/serverpod/lib/src/server/server.dart
  • packages/serverpod/lib/src/web_server/web_server.dart
  • packages/serverpod_client/test/test_utils/test_web_socket_server.dart
**/lib/**/*.dart

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Remove unnecessary comments from production code

Files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/routes/apple_server_notification_route.dart
  • packages/serverpod/lib/src/server/health_check.dart
  • packages/serverpod/lib/server.dart
  • packages/serverpod/lib/src/web_server/routes/static_route.dart
  • packages/serverpod/lib/src/server/server.dart
  • packages/serverpod/lib/src/web_server/web_server.dart
**/*_test.dart

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*_test.dart: Write test descriptions using the Given/When/Then pattern
Organize tests with passing/success cases first, group related cases using group(), then follow with error cases

Files:

  • tests/serverpod_test_server/test/middleware_test.dart
🧠 Learnings (17)
📓 Common learnings
Learnt from: nielsenko
PR: serverpod/serverpod#3980
File: templates/pubspecs/packages/serverpod/pubspec.yaml:31-34
Timestamp: 2025-09-17T16:08:02.694Z
Learning: When relic git dependencies with floating refs like "ref: merged" appear in Serverpod pubspecs, check for context about temporary measures for pending upstream PRs before flagging as supply chain risks.
📚 Learning: 2025-09-17T16:08:02.694Z
Learnt from: nielsenko
PR: serverpod/serverpod#3980
File: templates/pubspecs/packages/serverpod/pubspec.yaml:31-34
Timestamp: 2025-09-17T16:08:02.694Z
Learning: When relic git dependencies with floating refs like "ref: merged" appear in Serverpod pubspecs, check for context about temporary measures for pending upstream PRs before flagging as supply chain risks.

Applied to files:

  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
  • packages/serverpod_client/pubspec.yaml
  • templates/pubspecs/packages/serverpod_client/pubspec.yaml
  • tests/serverpod_test_server/pubspec.yaml
  • templates/pubspecs/packages/serverpod/pubspec.yaml
  • packages/serverpod/pubspec.yaml
📚 Learning: 2025-08-25T19:46:58.073Z
Learnt from: tp
PR: serverpod/serverpod#3917
File: modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/analysis_options.yaml:3-6
Timestamp: 2025-08-25T19:46:58.073Z
Learning: In Serverpod, test tool paths like `test/integration/test_tools/serverpod_test_tools.dart` are configured per project in the "generator.yaml" file and managed by a generator system, so they don't need to be updated manually across all files at once.

Applied to files:

  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
  • packages/serverpod/lib/src/server/health_check.dart
  • templates/pubspecs/packages/serverpod_client/pubspec.yaml
  • packages/serverpod/lib/server.dart
  • tests/serverpod_test_server/pubspec.yaml
  • packages/serverpod_client/test/test_utils/test_http_server.dart
  • packages/serverpod_client/test/test_utils/test_web_socket_server.dart
📚 Learning: 2025-07-02T16:09:27.702Z
Learnt from: tp
PR: serverpod/serverpod#3747
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/pubspec.yaml:37-38
Timestamp: 2025-07-02T16:09:27.702Z
Learning: In Serverpod migration testing, it's appropriate for test servers like serverpod_new_auth_test_server to include dependencies on both legacy packages (e.g., serverpod_auth_server) and new modular packages to enable comprehensive testing of migration paths from old to new authentication systems.

Applied to files:

  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
  • tests/serverpod_test_server/pubspec.yaml
📚 Learning: 2025-07-02T16:07:50.947Z
Learnt from: tp
PR: serverpod/serverpod#3747
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/migrating_email_endpoint_base.dart:4-4
Timestamp: 2025-07-02T16:07:50.947Z
Learning: In Serverpod, tp prefers importing the full package (e.g., 'package:serverpod_auth_migration_server/serverpod_auth_migration_server.dart') as a baseline rather than using smaller local imports, even within the same package where it might be considered a "self-import".

Applied to files:

  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
  • packages/serverpod/lib/src/server/health_check.dart
  • templates/pubspecs/packages/serverpod_client/pubspec.yaml
  • packages/serverpod/lib/server.dart
  • tests/serverpod_test_server/pubspec.yaml
  • templates/pubspecs/packages/serverpod/pubspec.yaml
  • packages/serverpod/pubspec.yaml
  • packages/serverpod/lib/src/server/server.dart
  • packages/serverpod/lib/src/web_server/web_server.dart
  • packages/serverpod_client/test/test_utils/test_web_socket_server.dart
📚 Learning: 2025-06-27T08:39:36.440Z
Learnt from: tp
PR: serverpod/serverpod#3721
File: util/pub_get_all:0-0
Timestamp: 2025-06-27T08:39:36.440Z
Learning: In the Serverpod project, `dart pub get` commands work fine on Flutter packages both locally and in CI environments, even when the package has `flutter: sdk: flutter` dependencies in pubspec.yaml. The technical constraint of Flutter SDK dependencies causing `dart pub` failures may not apply in all environments or recent Dart versions.

Applied to files:

  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
  • packages/serverpod_client/pubspec.yaml
  • packages/serverpod/lib/src/server/health_check.dart
  • templates/pubspecs/packages/serverpod_client/pubspec.yaml
  • tests/serverpod_test_server/pubspec.yaml
📚 Learning: 2025-08-06T06:58:47.019Z
Learnt from: tp
PR: serverpod/serverpod#3855
File: modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/apple_accounts.dart:143-159
Timestamp: 2025-08-06T06:58:47.019Z
Learning: The `_siwa.decodeAppleServerNotification` method from the sign_in_with_apple_server package automatically performs signature verification against Apple's published keys, including JWT signature verification and certificate chain validation. This means webhook handlers using this method already have built-in security against spoofed notifications.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
📚 Learning: 2025-09-17T16:09:20.868Z
Learnt from: nielsenko
PR: serverpod/serverpod#3980
File: packages/serverpod/lib/src/web_server/web_server.dart:102-115
Timestamp: 2025-09-17T16:09:20.868Z
Learning: In Serverpod's web server authentication handling (packages/serverpod/lib/src/web_server/web_server.dart), query parameter authentication fallback (`authenticationKey ??= queryParameters['auth']`) is intentionally maintained for legacy compatibility reasons, even though it has security implications regarding credential leakage.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
  • packages/serverpod/lib/src/server/health_check.dart
  • packages/serverpod/lib/server.dart
  • packages/serverpod/lib/src/server/server.dart
  • packages/serverpod/lib/src/web_server/web_server.dart
  • packages/serverpod_client/test/test_utils/test_web_socket_server.dart
📚 Learning: 2025-08-06T06:58:47.019Z
Learnt from: tp
PR: serverpod/serverpod#3855
File: modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/lib/src/business/apple_accounts.dart:143-159
Timestamp: 2025-08-06T06:58:47.019Z
Learning: In the sign_in_with_apple_server package, the `decodeAppleServerNotification` method performs complete JWT signature verification against Apple's published public keys. It fetches keys from https://appleid.apple.com/auth/keys, validates the audience and issuer, and cryptographically verifies the JWT signature. This means webhook handlers using this method already have proper security against spoofed notifications without needing additional signature verification code.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
📚 Learning: 2025-08-26T13:22:33.125Z
Learnt from: tp
PR: serverpod/serverpod#3829
File: modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/business/passkey_accounts.dart:0-0
Timestamp: 2025-08-26T13:22:33.125Z
Learning: The passkeys_server Dart library evolved from version 0.3.0 to 0.4.0, adding required parameters to verifyRegistration and verifyLogin methods for complete WebAuthn security validation including challenge, clientDataJSON, and attestationObject verification.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
  • packages/serverpod_client/test/test_utils/test_web_socket_server.dart
📚 Learning: 2025-07-15T13:38:58.183Z
Learnt from: tp
PR: serverpod/serverpod#3787
File: modules/new_serverpod_auth/serverpod_auth_apple_account/serverpod_auth_apple_account_server/pubspec.yaml:18-18
Timestamp: 2025-07-15T13:38:58.183Z
Learning: For Sign in with Apple authentication, there are two distinct packages: `sign_in_with_apple` is the client-side package for mobile apps, while `sign_in_with_apple_server` is a server-side utility package for handling Sign in with Apple tokens and validation on Dart servers.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
📚 Learning: 2025-07-24T13:01:52.743Z
Learnt from: tp
PR: serverpod/serverpod#3826
File: modules/new_serverpod_auth/serverpod_auth_apple/serverpod_auth_apple_client/lib/serverpod_auth_apple_client.dart:1-1
Timestamp: 2025-07-24T13:01:52.743Z
Learning: High-level serverpod_auth_* packages (like serverpod_auth_apple_client) should re-export their serverpod_auth_* dependencies so that consumers only need to import the high-level package and don't get warnings about importing from non-dependency packages. The re-exports should hide conflicting elements like 'Caller' and 'Protocol' to avoid naming conflicts. This pattern prevents users from needing to directly depend on multiple internal implementation packages.

Applied to files:

  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
  • packages/serverpod/lib/server.dart
📚 Learning: 2025-09-17T16:08:47.035Z
Learnt from: nielsenko
PR: serverpod/serverpod#3980
File: tests/serverpod_test_server/test_integration/static_files_test.dart:10-10
Timestamp: 2025-09-17T16:08:47.035Z
Learning: In Dart, multiple imports can use the same alias prefix (e.g., `import 'package:http/http.dart' as http;` and `import 'package:http/io_client.dart' as http;`) as long as there are no actual symbol conflicts in the code usage. The compiler resolves symbols correctly even with shared prefixes when the used symbols don't conflict.

Applied to files:

  • packages/serverpod/lib/src/server/health_check.dart
📚 Learning: 2025-06-17T11:40:09.088Z
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_client/CHANGELOG.md:1-7
Timestamp: 2025-06-17T11:40:09.088Z
Learning: CHANGELOG.md files in the serverpod_auth_migration modules (client and server) are auto-generated and cannot be manually modified during the development process.

Applied to files:

  • templates/pubspecs/packages/serverpod_client/pubspec.yaml
📚 Learning: 2025-07-01T13:01:27.054Z
Learnt from: exaby73
PR: serverpod/serverpod#3741
File: modules/serverpod_auth/serverpod_auth_server/analysis_options.yaml:14-16
Timestamp: 2025-07-01T13:01:27.054Z
Learning: In Serverpod, first-party packages like serverpod_auth_server can appropriately use blanket `invalid_use_of_internal_member: ignore` directives in their analysis_options.yaml since they use internal Database methods internally without exposing them in their public APIs to end users.

Applied to files:

  • packages/serverpod/lib/server.dart
📚 Learning: 2025-10-15T11:44:29.873Z
Learnt from: CR
PR: serverpod/serverpod#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T11:44:29.873Z
Learning: Applies to **/lib/**/*.dart : Remove unnecessary comments from production code

Applied to files:

  • packages/serverpod/lib/server.dart
📚 Learning: 2025-09-17T16:12:41.338Z
Learnt from: nielsenko
PR: serverpod/serverpod#3980
File: packages/serverpod/lib/src/web_server/routes/static_directory.dart:62-79
Timestamp: 2025-09-17T16:12:41.338Z
Learning: In Serverpod's RouteStaticDirectory, the serverDirectory parameter is set by developers at server startup, not from user requests. Developers may legitimately want to serve static files from outside the web/ directory (e.g., ../shared-assets), so directory traversal validation is not needed for this configuration parameter.

Applied to files:

  • packages/serverpod/lib/src/web_server/routes/static_route.dart
🔇 Additional comments (22)
modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart (1)

224-236: LGTM! Type migration aligns with Relic 0.9.1 update.

The parameter type change from NewContext to Context correctly reflects the Relic library upgrade. The logic remains unchanged, and the cast to RespondableContext on line 235 follows the standard Relic handler pattern.

packages/serverpod_client/test/test_utils/test_http_server.dart (3)

40-42: Context type migration looks correct.

The parameter type change from NewContext to RequestContext aligns with the relic 0.9.1 API changes documented in the PR objectives. The function logic remains intact.


44-50: Factory pattern for adapter initialization looks correct.

The change from awaiting IOAdapter.bind() directly to passing a factory function () => IOAdapter.bind(...) aligns with relic 0.9.1's new initialization pattern. This allows the server to control adapter lifecycle timing.


52-54: Simplified port access looks correct.

The change from (server.adapter as IOAdapter).port to server.port represents a cleaner API that eliminates the need for type casting. The port should be available after mountAndStart() completes.

packages/serverpod_client/test/test_utils/test_web_socket_server.dart (1)

33-46: WebSocket test utility migration looks correct.

The changes mirror those in test_http_server.dart and consistently apply the relic 0.9.1 migration:

  • NewContext → RequestContext (line 33)
  • Factory function pattern for adapter initialization (line 38)
  • Direct server.port access (line 46)

The WebSocket-specific logic (context.connect) remains appropriately unchanged.

templates/pubspecs/packages/serverpod/pubspec.yaml (1)

31-31: relic 0.9.1 verified as available and secure.

Version 0.9.1 is published on pub.dev with no security advisories. The version bump is sound.

packages/serverpod/lib/server.dart (1)

10-10: LGTM! Internal API exposure properly removed.

The removal of hide ServerInternalMethods is appropriate since the extension has been removed from the codebase. This aligns with the documented breaking change where ioServer getter access is replaced with the public server.connectionsInfo() method.

tests/serverpod_test_server/test/middleware_test.dart (2)

102-102: LGTM! Signature updated to match Route base class.

The parameter type change from NewContext to RequestContext correctly aligns with the updated Route.handleCall signature in the Relic migration.


110-112: LGTM! Extension scope widened appropriately.

Changing the extension target from RequestContext to Context is a good design decision. Since RequestContext extends Context, this allows the authInfo property to be accessed in both middleware handlers (which receive Context) and route handlers (which receive RequestContext), maintaining full compatibility.

packages/serverpod/lib/src/web_server/routes/static_route.dart (2)

7-11: LGTM! Factory signature updated consistently.

The CacheControlFactory parameter type update from NewContext to RequestContext aligns with the broader type migration.


64-67: LGTM! Route signature updated to match base class.

The handleCall method signature correctly updates to use RequestContext, matching the updated Route base class contract.

packages/serverpod/lib/src/server/server.dart (5)

130-137: LGTM! Factory pattern correctly implemented.

The RelicServer initialization now uses a factory function () => IOAdapter.bind(...) as required by Relic 0.9.1. The port is correctly retrieved from server.port after the server starts, eliminating the need for type casting.


155-170: LGTM! Request handler signature updated.

The parameter type change from NewContext to RequestContext aligns with Relic 0.9.1's type system. Error handling and response logic remain unchanged.


172-276: LGTM! Internal request handling updated consistently.

The _handleRequest method signature correctly updates to RequestContext. All internal logic for health checks, WebSocket upgrades, and request processing remains functionally equivalent.


372-406: LGTM! WebSocket upgrade handler updated.

The parameter type change to RequestContext is consistent with the broader migration. WebSocket handling logic remains unchanged.


626-627: Verify server initialization before calling connectionsInfo().

The new public connectionsInfo() method uses a non-null assertion on _relicServer!. Ensure that callers only invoke this method after the server has been successfully started, or add appropriate null checks and error handling.

packages/serverpod/lib/src/web_server/web_server.dart (5)

86-93: LGTM! Port retrieval simplified.

The change from (server.adapter as IOAdapter).port to server.port is cleaner and eliminates the need for type casting, leveraging the direct port exposure from RelicServer.


215-226: LGTM! Extension scope widened for better reusability.

Changing SessionEx from extension on RequestContext to extension on Context is a good design decision. Since RequestContext extends Context, this allows session access in both middleware (which receives Context) and routes (which receive RequestContext), improving code reusability while maintaining type safety.


245-253: LGTM! Route.call signature updated consistently.

The parameter type change to RequestContext aligns with Relic 0.9.1's type system. The method correctly forwards to handleCall with both session and context.


255-257: LGTM! Route.handleCall signature updated.

The abstract method signature correctly updates to use RequestContext, establishing the contract for all Route implementations.


267-291: LGTM! WidgetRoute.handleCall signature updated.

The parameter type change to RequestContext maintains consistency with the Route base class contract. Widget building and response handling logic remains unchanged.

modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/routes/apple_server_notification_route.dart (1)

16-19: LGTM! Type migration aligns with Relic upgrade.

The parameter type change from NewContext to RequestContext correctly implements the breaking change required for Relic 0.9.1. The signature update is consistent with the broader migration across the codebase.

@nielsenko nielsenko self-assigned this Oct 30, 2025
@nielsenko
nielsenko marked this pull request as ready for review October 30, 2025 11:53
@nielsenko
nielsenko requested a review from a team October 30, 2025 11:53

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nielsenko
nielsenko merged commit 273ef65 into serverpod:main Oct 30, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants