Repository navigation
chore: Update relic to 0.9.1 - #4125
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThe PR migrates context parameter types from Changes
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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 |
b20aa5e to
7c88dba
Compare
7c88dba to
bcb464f
Compare
bcb464f to
74ec505
Compare
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
1 similar comment
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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 usingdart 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.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/routes/apple_server_notification_route.dartpackages/serverpod/lib/src/server/health_check.darttests/serverpod_test_server/test/middleware_test.dartpackages/serverpod/lib/server.dartpackages/serverpod/lib/src/web_server/routes/static_route.dartpackages/serverpod_client/test/test_utils/test_http_server.dartpackages/serverpod/lib/src/server/server.dartpackages/serverpod/lib/src/web_server/web_server.dartpackages/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.dartmodules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/routes/apple_server_notification_route.dartpackages/serverpod/lib/src/server/health_check.dartpackages/serverpod/lib/server.dartpackages/serverpod/lib/src/web_server/routes/static_route.dartpackages/serverpod/lib/src/server/server.dartpackages/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.yamlpackages/serverpod_client/pubspec.yamltemplates/pubspecs/packages/serverpod_client/pubspec.yamltests/serverpod_test_server/pubspec.yamltemplates/pubspecs/packages/serverpod/pubspec.yamlpackages/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.yamlpackages/serverpod/lib/src/server/health_check.darttemplates/pubspecs/packages/serverpod_client/pubspec.yamlpackages/serverpod/lib/server.darttests/serverpod_test_server/pubspec.yamlpackages/serverpod_client/test/test_utils/test_http_server.dartpackages/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.yamltests/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.yamlpackages/serverpod/lib/src/server/health_check.darttemplates/pubspecs/packages/serverpod_client/pubspec.yamlpackages/serverpod/lib/server.darttests/serverpod_test_server/pubspec.yamltemplates/pubspecs/packages/serverpod/pubspec.yamlpackages/serverpod/pubspec.yamlpackages/serverpod/lib/src/server/server.dartpackages/serverpod/lib/src/web_server/web_server.dartpackages/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.yamlpackages/serverpod_client/pubspec.yamlpackages/serverpod/lib/src/server/health_check.darttemplates/pubspecs/packages/serverpod_client/pubspec.yamltests/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.dartpackages/serverpod/lib/src/server/health_check.dartpackages/serverpod/lib/server.dartpackages/serverpod/lib/src/server/server.dartpackages/serverpod/lib/src/web_server/web_server.dartpackages/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.dartpackages/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.dartpackages/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
NewContexttoContextcorrectly reflects the Relic library upgrade. The logic remains unchanged, and the cast toRespondableContexton 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
NewContexttoRequestContextaligns 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).porttoserver.portrepresents a cleaner API that eliminates the need for type casting. The port should be available aftermountAndStart()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.dartand consistently apply the relic 0.9.1 migration:
NewContext→RequestContext(line 33)- Factory function pattern for adapter initialization (line 38)
- Direct
server.portaccess (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 ServerInternalMethodsis appropriate since the extension has been removed from the codebase. This aligns with the documented breaking change whereioServergetter access is replaced with the publicserver.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
NewContexttoRequestContextcorrectly aligns with the updatedRoute.handleCallsignature in the Relic migration.
110-112: LGTM! Extension scope widened appropriately.Changing the extension target from
RequestContexttoContextis a good design decision. SinceRequestContextextendsContext, this allows theauthInfoproperty to be accessed in both middleware handlers (which receiveContext) and route handlers (which receiveRequestContext), maintaining full compatibility.packages/serverpod/lib/src/web_server/routes/static_route.dart (2)
7-11: LGTM! Factory signature updated consistently.The
CacheControlFactoryparameter type update fromNewContexttoRequestContextaligns with the broader type migration.
64-67: LGTM! Route signature updated to match base class.The
handleCallmethod signature correctly updates to useRequestContext, matching the updatedRoutebase 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 fromserver.portafter the server starts, eliminating the need for type casting.
155-170: LGTM! Request handler signature updated.The parameter type change from
NewContexttoRequestContextaligns with Relic 0.9.1's type system. Error handling and response logic remain unchanged.
172-276: LGTM! Internal request handling updated consistently.The
_handleRequestmethod signature correctly updates toRequestContext. 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
RequestContextis 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).porttoserver.portis 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
SessionExfromextension on RequestContexttoextension on Contextis a good design decision. SinceRequestContextextendsContext, this allows session access in both middleware (which receivesContext) and routes (which receiveRequestContext), improving code reusability while maintaining type safety.
245-253: LGTM! Route.call signature updated consistently.The parameter type change to
RequestContextaligns with Relic 0.9.1's type system. The method correctly forwards tohandleCallwith 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
RequestContextmaintains 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
NewContexttoRequestContextcorrectly implements the breaking change required for Relic 0.9.1. The signature update is consistent with the broader migration across the codebase.
Description
This PR updates Serverpod to use Relic 0.9.1.
relicfrom^0.8.0to^0.9.1NewContexttoRequestContextthroughout the codebase to align with Relic's new naming conventionsRelicServerto use a factory function pattern (() => IOAdapter.bind(...)) instead of awaiting the adapter before creating the serverServerInternalMethodsextension andioServergetter, replacing it with a publicconnectionsInfo()methodioServer.connectionsInfo()to using the newserver.connectionsInfo()async methodSessionExextension to work onContextinstead ofRequestContextwhere appropriateFixes #?
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.Breaking changes
ioServergetter is no longer available. Useserver.connectionsInfo()instead to get connection information.NewContextmust be updated to useRequestContext. This primarily affects custom routes and middleware implementations.Summary by CodeRabbit
New Features
connectionsInfo()method to monitor active server connections.Chores