Skip to content

chore!: Update relic to ^0.10.0 - #4160

Merged
nielsenko merged 3 commits into
serverpod:mainfrom
nielsenko:update-relic-0.10.0
Nov 5, 2025
Merged

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

Conversation

@nielsenko

@nielsenko nielsenko commented Nov 5, 2025 •

Copy link
Copy Markdown
Collaborator

Changes

  • Updated relic dependency from ^0.9.1 to ^0.10.0 across all packages and templates

API Migration

The main breaking change in Relic 0.10.0 is the simplification of the request handling API:

  1. Context API removed: Context, RequestContext, RespondableContext, and HandledContext have been removed.
  2. Direct Request/Response handling: Handlers now work directly with Request and return Response (or other Result sub-types).
  3. context.connect() replaced with WebSocketUpgrade
  4. Renamed Result type: Internal Result type renamed to EndpointResult to avoid conflicts with Relic's Result

Code Changes

  • Updated all route handlers to use new signature: FutureOr<Result> handleCall(Session session, Request req)
  • Replaced context.respond(response) with direct return response
  • Updated WebSocket upgrade handling to use WebSocketUpgrade constructor
  • Renamed internal Result type to EndpointResult to avoid naming conflicts
  • Updated middleware to work with Request directly instead of Context
  • Added hide Message clause to avoid conflicts with mailer package in auth_example

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.

If you need help, consider asking for advice on the discussion board.

Breaking changes

This is a breaking change for users who have custom routes or middleware:

  1. Route handlers must update their signature from:

    FutureOr<HandledContext> handleCall(Session session, RequestContext context)

    to:

    FutureOr<Result> handleCall(Session session, Request request)
  2. Response handling must change from:

    return context.respond(Response.ok(...));

    to:

    return Response.ok(...);
  3. WebSocket upgrades must change from:

    return context.connect((webSocket) async { ... });

    to:

    return WebSocketUpgrade((webSocket) async { ... });
  4. Middleware must update to work with Request directly instead of Context:

    Handler call(Handler next) {
      return (req) async {  // Changed from (ctx)
        // Work with req directly
        return await next(req);
      };
    }
  5. Context properties now attach to Request instead of Context:

    extension on Request {  // Changed from Context
      Session get session => _sessionProperty[this];
    }

Summary by CodeRabbit

Release Notes

  • Refactor

    • Modernized internal request and response handling infrastructure for improved maintainability.
  • Chores

    • Updated the relic dependency to version 0.10.0 for enhanced functionality and compatibility.

@coderabbitai

coderabbitai Bot commented Nov 5, 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

This PR migrates Serverpod's request handling from a RequestContext/Context-based model to a Request-based model and introduces a new EndpointResult type hierarchy. It updates route handlers, middleware, and internal server logic while bumping the relic dependency version across multiple pubspec files.

Changes

Cohort / File(s) Summary
Result Type Hierarchy Refactoring
packages/serverpod/lib/src/server/endpoint_dispatch.dart
Base type renamed from Result to EndpointResult; all concrete result classes (ResultSuccess, ResultInvalidParams, ResultNoSuchEndpoint, ResultAuthenticationFailed, ResultInternalServerError, ResultStatusCode, ExceptionResult) now extend EndpointResult. Several classes gain new fields, constructors, and updated toString methods.
Server Request & Response Handling Migration
packages/serverpod/lib/src/server/server.dart
Internal request handlers refactored to use Request (renamed from RequestContext) and return EndpointResult-based flows. Error handling, body reading, and response construction updated to operate directly on Request objects and return Response instead of using context-based response delivery.
Web Server Routing & Middleware Updates
packages/serverpod/lib/src/web_server/web_server.dart
Route base class methods (call, handleCall) and WidgetRoute updated to accept Request instead of RequestContext and return FutureOr<Result> instead of FutureOr<HandledContext>. Session and exception middleware refactored to operate on Request. SessionEx extension target changed from Context to Request.
Static Route Handler Update
packages/serverpod/lib/src/web_server/routes/static_route.dart
Route handler signature updated from FutureOr<HandledContext> handleCall(Session, RequestContext) to FutureOr<Result> handleCall(Session, Request).
Apple IDP Provider Updates
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
Apple notification handler wrapper updated to consume Request instead of Context; body reading and response handling adjusted. Route handler signature changed from FutureOr<HandledContext> handleCall(Session, RequestContext) to FutureOr<Result> handleCall(Session, Request).
Relic Dependency Version 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
Relic dependency bumped from ^0.9.1 to ^0.10.0 across all pubspec files.
Relic Export Update
packages/serverpod/lib/serverpod.dart
Relic re-export changed from export 'package:relic/relic.dart' hide ExceptionHandler; to export 'package:relic/relic.dart';, making ExceptionHandler publicly exported.
Test & Example Handler Updates
packages/serverpod_client/test/test_utils/test_http_server.dart, packages/serverpod_client/test/test_utils/test_web_socket_server.dart, tests/serverpod_test_server/test/middleware_test.dart, examples/auth_example/auth_example_server/lib/server.dart
Request handlers refactored to use Request instead of RequestContext and return FutureOr<Result> instead of FutureOr<HandledContext>. Test middleware updated to work with new types. Import statements adjusted to avoid name conflicts.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Server as Server/WebServer
    participant Route
    participant Handler as Request Handler
    participant Result as Result Chain

    Note over Server,Result: Old Flow (RequestContext-based)
    Client->>Server: HTTP Request
    Server->>Server: Create RequestContext
    Server->>Route: call(RequestContext)
    Route->>Handler: handleCall(Session, RequestContext)
    Handler->>Result: Build response via context.respond()
    Result->>Server: Return HandledContext
    Server->>Client: HTTP Response

    Note over Server,Result: New Flow (Request-based)
    Client->>Server: HTTP Request
    Server->>Server: Create Request
    Server->>Route: call(Request)
    Route->>Handler: handleCall(Session, Request)
    Handler->>Result: Build response directly
    Result->>Result: Return EndpointResult
    Result->>Server: Convert to Response
    Server->>Client: HTTP Response
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

  • High complexity areas requiring careful review:
    • packages/serverpod/lib/src/server/endpoint_dispatch.dart — Substantial refactoring of result type hierarchy with multiple class signature changes, new fields, and constructor updates across seven result classes
    • packages/serverpod/lib/src/server/server.dart — Core server request/response pipeline refactored; multiple internal methods converted to new Request-based flow with updated error handling paths
    • packages/serverpod/lib/src/web_server/web_server.dart — Public API changes to Route and WidgetRoute base classes; middleware refactored; extension target changed; ensure session/exception handling works correctly with new Request types
    • Request type migration consistency — Verify all callsites correctly transition from RequestContext/Context to Request and that session/authentication context is properly propagated

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is comprehensive and includes detailed API migration notes, code changes, and breaking changes. However, it does not list a specific issue number (shows 'Fixes #?' incomplete). Replace 'Fixes #?' with the actual issue number that this PR addresses to complete the required checklist item about listing fixed issues.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: updating the relic dependency to ^0.10.0. It's concise, specific, and clearly communicates the primary update across all packages.

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 self-assigned this Nov 5, 2025
@nielsenko nielsenko changed the title chore: Update relic to ^0.10.0 chore!: Update relic to ^0.10.0 Nov 5, 2025
@nielsenko

Copy link
Copy Markdown
Collaborator Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Nov 5, 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: 0

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

18-18: Consider renaming parameter for consistency.

The parameter is typed as Request but named context, which is inconsistent with the migration away from Context-based APIs. Other files in this PR use req or request for Request parameters (e.g., packages/serverpod/lib/src/server/server.dart uses req, packages/serverpod_client/test/test_utils/test_http_server.dart uses req).

Apply this diff for consistency:

   FutureOr<Result> handleCall(
     final Session _,
-    final Request context,
+    final Request req,
   ) {
-    return _utils.revokedNotificationHandler()(context);
+    return _utils.revokedNotificationHandler()(req);
   }
packages/serverpod_client/test/test_utils/test_web_socket_server.dart (1)

33-35: Consider marking unused parameter.

The Request req parameter is declared but not used in the handler body. While this may be intentional for a simple test utility, marking it as unused improves clarity.

Apply this diff:

-    FutureOr<Result> requestHandler(Request req) async {
+    FutureOr<Result> requestHandler(Request _) async {
       return WebSocketUpgrade(webSocketHandler);
     }
packages/serverpod/lib/src/web_server/routes/static_route.dart (1)

65-66: Consider renaming parameter for consistency.

The parameter is typed as Request but named context, which is inconsistent with the migration away from Context-based APIs. Other files in this PR consistently use req or request for Request parameters (e.g., packages/serverpod/lib/src/server/server.dart uses req).

Apply this diff:

-  FutureOr<Result> handleCall(Session session, Request context) =>
-      _handler(context);
+  FutureOr<Result> handleCall(Session session, Request req) =>
+      _handler(req);
packages/serverpod/lib/src/web_server/web_server.dart (1)

214-225: Doc comment still references Context

The extension now targets Request, so the summary should reference Request instead of Context to avoid confusion for callers browsing the API docs. A quick wording tweak keeps the documentation aligned with the new signature.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58b2a11 and c67fe71.

📒 Files selected for processing (17)
  • examples/auth_example/auth_example_server/lib/server.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart (2 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/serverpod.dart (1 hunks)
  • packages/serverpod/lib/src/server/endpoint_dispatch.dart (7 hunks)
  • packages/serverpod/lib/src/server/server.dart (7 hunks)
  • packages/serverpod/lib/src/web_server/routes/static_route.dart (2 hunks)
  • packages/serverpod/lib/src/web_server/web_server.dart (6 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/routes/apple_server_notification_route.dart
  • packages/serverpod/lib/serverpod.dart
  • packages/serverpod/lib/src/web_server/routes/static_route.dart
  • 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
  • tests/serverpod_test_server/test/middleware_test.dart
  • packages/serverpod/lib/src/server/endpoint_dispatch.dart
  • packages/serverpod/lib/src/server/server.dart
  • packages/serverpod_client/test/test_utils/test_http_server.dart
  • packages/serverpod/lib/src/web_server/web_server.dart
  • examples/auth_example/auth_example_server/lib/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/routes/apple_server_notification_route.dart
  • packages/serverpod/lib/serverpod.dart
  • packages/serverpod/lib/src/web_server/routes/static_route.dart
  • 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/endpoint_dispatch.dart
  • packages/serverpod/lib/src/server/server.dart
  • packages/serverpod/lib/src/web_server/web_server.dart
  • examples/auth_example/auth_example_server/lib/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
Repo: serverpod/serverpod PR: 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.
Learnt from: SandPod
Repo: serverpod/serverpod PR: 4144
File: modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_idp_base_endpoint.dart:0-0
Timestamp: 2025-11-03T15:40:41.827Z
Learning: In Serverpod authentication IDP endpoint files (modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server), endpoint base classes should import `serverpod_auth_idp_server/core.dart` to access the Session type, rather than importing `package:serverpod_auth_core_server/session.dart` directly. This pattern is consistently used in Apple, Email, and Google endpoint files.
Learnt from: tp
Repo: serverpod/serverpod PR: 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.
📚 Learning: 2025-11-03T15:40:41.827Z
Learnt from: SandPod
Repo: serverpod/serverpod PR: 4144
File: modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/passkey/endpoints/passkey_idp_base_endpoint.dart:0-0
Timestamp: 2025-11-03T15:40:41.827Z
Learning: In Serverpod authentication IDP endpoint files (modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server), endpoint base classes should import `serverpod_auth_idp_server/core.dart` to access the Session type, rather than importing `package:serverpod_auth_core_server/session.dart` directly. This pattern is consistently used in Apple, Email, and Google endpoint files.

Applied to files:

  • 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/serverpod.dart
  • modules/new_serverpod_auth/serverpod_auth_idp/serverpod_auth_idp_server/lib/src/providers/apple/business/apple_idp_utils.dart
  • tests/serverpod_test_server/test/middleware_test.dart
  • packages/serverpod/lib/src/server/endpoint_dispatch.dart
  • packages/serverpod/lib/src/server/server.dart
  • packages/serverpod/lib/src/web_server/web_server.dart
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-09-17T16:09:20.868Z
Learnt from: nielsenko
Repo: serverpod/serverpod PR: 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/routes/apple_server_notification_route.dart
  • packages/serverpod/lib/serverpod.dart
  • 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/server.dart
  • packages/serverpod/lib/src/web_server/web_server.dart
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-09-17T16:08:02.694Z
Learnt from: nielsenko
Repo: serverpod/serverpod PR: 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/packages/serverpod/pubspec.yaml
  • templates/pubspecs/packages/serverpod_client/pubspec.yaml
  • packages/serverpod/pubspec.yaml
  • tests/serverpod_test_server/pubspec.yaml
  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
📚 Learning: 2025-06-27T08:39:36.440Z
Learnt from: tp
Repo: serverpod/serverpod PR: 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:

  • packages/serverpod_client/pubspec.yaml
  • templates/pubspecs/packages/serverpod_client/pubspec.yaml
  • tests/serverpod_test_server/pubspec.yaml
  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
📚 Learning: 2025-07-02T16:07:50.947Z
Learnt from: tp
Repo: serverpod/serverpod PR: 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:

  • packages/serverpod/lib/serverpod.dart
  • templates/pubspecs/packages/serverpod_client/pubspec.yaml
  • packages/serverpod/lib/src/server/server.dart
  • tests/serverpod_test_server/pubspec.yaml
  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-07-24T13:01:52.743Z
Learnt from: tp
Repo: serverpod/serverpod PR: 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:

  • packages/serverpod/lib/serverpod.dart
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-07-01T13:01:27.054Z
Learnt from: exaby73
Repo: serverpod/serverpod PR: 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/serverpod.dart
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-11-04T12:09:52.649Z
Learnt from: marcelomendoncasoares
Repo: serverpod/serverpod PR: 4150
File: examples/auth/auth_flutter/lib/widgets/profile_info.dart:23-30
Timestamp: 2025-11-04T12:09:52.649Z
Learning: In Serverpod example and testing projects (e.g., examples/auth/auth_flutter), prefer letting errors bubble up naturally rather than handling them gracefully with catchError or try-catch blocks. This helps developers see what went wrong during development and testing.

Applied to files:

  • packages/serverpod/lib/serverpod.dart
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-08-25T19:46:58.073Z
Learnt from: tp
Repo: serverpod/serverpod PR: 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:

  • packages/serverpod/lib/serverpod.dart
  • packages/serverpod/lib/src/server/server.dart
  • tests/serverpod_test_server/pubspec.yaml
  • templates/pubspecs/tests/serverpod_test_server/pubspec.yaml
  • packages/serverpod_client/test/test_utils/test_http_server.dart
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-06-27T07:44:09.048Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3721
File: modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/test/serverpod_auth_session_flutter_test.dart:1-7
Timestamp: 2025-06-27T07:44:09.048Z
Learning: In Serverpod packages, the `uuid` package is re-exported through a chain: `serverpod_auth_session_client` re-exports `serverpod_client`, which re-exports `serverpod_serialization`, which re-exports `uuid`. This means `Uuid` class is available in files that import `serverpod_auth_session_client` without needing a direct `uuid` package import.

Applied to files:

  • packages/serverpod/lib/serverpod.dart
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-07-02T16:09:27.702Z
Learnt from: tp
Repo: serverpod/serverpod PR: 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:

  • packages/serverpod/lib/serverpod.dart
  • tests/serverpod_test_server/pubspec.yaml
  • examples/auth_example/auth_example_server/lib/server.dart
📚 Learning: 2025-08-06T06:58:47.019Z
Learnt from: tp
Repo: serverpod/serverpod PR: 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-08-06T06:58:47.019Z
Learnt from: tp
Repo: serverpod/serverpod PR: 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
Repo: serverpod/serverpod PR: 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/lib/src/server/server.dart
📚 Learning: 2025-07-15T13:38:58.183Z
Learnt from: tp
Repo: serverpod/serverpod PR: 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-23T13:18:31.864Z
Learnt from: tp
Repo: serverpod/serverpod PR: 3820
File: modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server/lib/src/endpoints/user_profile_base_endpoint.dart:8-8
Timestamp: 2025-07-23T13:18:31.864Z
Learning: Abstract Endpoint classes in Serverpod should end with the "BaseEndpoint" suffix in their name (e.g., UserProfileBaseEndpoint). This naming convention should be enforced consistently across the codebase.

Applied to files:

  • packages/serverpod/lib/src/server/endpoint_dispatch.dart
🔇 Additional comments (20)
examples/auth_example/auth_example_server/lib/server.dart (1)

5-5: LGTM! Correctly resolves naming conflict.

Hiding the Message symbol from serverpod prevents a clash with the mailer package's Message class, which is used for email composition in this file.

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

31-31: LGTM: Relic version bump aligns with API migration.

The upgrade to ^0.10.0 is consistent across the codebase and supports the Request/Response-based API migration described in the PR objectives.

packages/serverpod_client/pubspec.yaml (1)

23-23: LGTM: Consistent dev dependency update.

The relic version bump to ^0.10.0 as a dev dependency aligns with the broader migration.

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

22-22: LGTM: Template update consistent with generated files.

The relic version bump matches the corresponding changes in generated client pubspecs.

templates/pubspecs/tests/serverpod_test_server/pubspec.yaml (1)

14-14: LGTM: Test server dependency update appropriate.

The relic upgrade to ^0.10.0 as a regular dependency is appropriate for test server code that directly uses routing and handler functionality.

packages/serverpod/pubspec.yaml (1)

32-32: LGTM: Core dependency update enables new API.

The relic upgrade to ^0.10.0 in the main serverpod package correctly reflects the dependency needed for Request/Response-based routing.

tests/serverpod_test_server/pubspec.yaml (1)

15-15: LGTM: Test server dependency consistent with template.

The relic version bump matches the template configuration and supports the API migration testing.

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

18-18: Verify documentation of ExceptionHandler exposure.

This change now publicly exports ExceptionHandler from relic, which was previously hidden. This expands the public API surface and could cause naming conflicts for consumers with their own ExceptionHandler types.

Please confirm this API change is documented in the breaking changes section of the PR, specifically noting that ExceptionHandler is now exported and may require consumers to handle naming conflicts if they have similarly named types.

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

203-215: LGTM: Handler correctly migrated to Request/Response pattern.

The handler signature and implementation correctly follow the new API pattern:

  • Accepts Request req parameter instead of Context
  • Reads body via req.body.read() stream
  • Returns Response.ok() directly instead of using context methods

The migration preserves the notification decoding and handling logic while adapting to the new request/response flow.

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

40-42: LGTM!

The request handler signature correctly migrates to the new Request-based API, and the direct return of the httpRequestHandler result aligns with the Result-based flow.

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

102-104: LGTM!

The route handler correctly migrates to the Request-based signature and properly accesses authentication info through the new Request extension.


109-111: LGTM!

The extension correctly moves from Context to Request, maintaining the same property access pattern for authentication info.


114-121: LGTM!

The middleware correctly adapts to the new Request-based flow, returning Response directly instead of using context.respond patterns.

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

158-173: LGTM!

The request handler correctly migrates to the Request-based API with proper error handling and fallback to internal server error response.


175-277: LGTM!

The request handling flow correctly migrates to the Request-based API, with proper response construction throughout all paths (health checks, OPTIONS, error cases, and normal flow).


293-371: LGTM!

The response conversion correctly handles all EndpointResult cases and constructs appropriate Response objects with proper status codes, headers, and body content.


373-407: LGTM!

The WebSocket upgrade flow correctly migrates to the new WebSocketUpgrade pattern and Request-based API, maintaining proper error handling and connection tracking.


431-584: LGTM!

The URI call handling correctly migrates to return EndpointResult types and uses the Request parameter appropriately throughout the authentication, session creation, and method invocation flow.


279-291: LGTM!

The malformed call logging correctly adapts to the EndpointResult type while maintaining the same logging behavior.


602-625: LGTM!

The framework exception reporting correctly accepts the optional Request parameter and creates appropriate diagnostic context.

@nielsenko
nielsenko force-pushed the update-relic-0.10.0 branch 2 times, most recently from 593e780 to c67fe71 Compare November 5, 2025 11:22
@nielsenko
nielsenko requested a review from a team November 5, 2025 12:51
@nielsenko
nielsenko marked this pull request as ready for review November 5, 2025 12:51

@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 76a1ff3 into serverpod:main Nov 5, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2025
@nielsenko
nielsenko deleted the update-relic-0.10.0 branch August 20, 2026 15:10
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