Skip to content

feat(auth2): Bundle auth user operations in AuthUsers class - #3634

Merged
tp merged 9 commits into
serverpod:mainfrom
tp:auth-users-class
Jun 13, 2025
Merged

tp merged 9 commits into
serverpod:mainfrom
tp:auth-users-class

Conversation

@tp

@tp tp commented Jun 12, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Introduced AuthUserModel and AuthUserNotFoundException for authentication users.
    • Added high-level methods to create, retrieve, update, list, and delete authentication users.
    • Improved error handling for non-existent authentication users.
  • Refactor

    • Replaced direct database calls with helper methods for user management.
    • Updated scope-handling extensions to apply to the new data model.
  • Tests

    • Added integration tests covering user lifecycle operations and error scenarios.
  • Chores

    • Added clock and meta dependencies and updated test version constraint.

@tp
tp force-pushed the auth-users-class branch from 746a869 to 4a2f0fe Compare June 12, 2025 08:19
tp added 2 commits June 12, 2025 11:03
@tp
tp force-pushed the auth-users-class branch from 4a2f0fe to 92ab850 Compare June 12, 2025 09:03
@tp
tp marked this pull request as ready for review June 12, 2025 09:04
@tp
tp requested a review from SandPod June 12, 2025 09:04
@tp

tp commented Jun 12, 2025 •

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 12, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@coderabbitai

coderabbitai Bot commented Jun 12, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This update introduces a new abstraction layer for managing authentication users via the AuthUsers class, replacing direct database operations with higher-level helper methods. It adds new data models (AuthUserModel) and exceptions (AuthUserNotFoundException), updates protocol serialization, and modifies tests and utilities to use the new abstractions. Exports and dependencies are adjusted accordingly.

Changes

File(s) Change Summary
.../serverpod_auth_email_server/lib/src/endpoints/email_account_endpoint.dart Replaced direct AuthUser DB operations with AuthUsers helper methods for user creation and retrieval.
.../serverpod_auth_email_account_server/test/test_utils.dart Updated createAuthUser to use AuthUsers.create; cleanup now deletes users via AuthUsers.
.../serverpod_auth_jwt_server/test/integration/authentication_handler_test.dart Test setup now creates users via AuthUsers.create instead of direct DB insertions.
.../serverpod_auth_session_server/test/test_utils.dart Refactored createAuthUser to delegate to AuthUsers.create.
.../serverpod_auth_user_client/lib/src/protocol/auth_user_model.dart Added new AuthUserModel class for representing authenticated users.
.../serverpod_auth_user_client/lib/src/protocol/auth_user_not_found_exception.dart Added new AuthUserNotFoundException class for signaling missing users.
.../serverpod_auth_user_client/lib/src/protocol/protocol.dart Integrated AuthUserModel and AuthUserNotFoundException into protocol serialization/deserialization.
.../serverpod_auth_user_server/lib/serverpod_auth_user_server.dart Updated exports: added AuthUsers, restricted protocol exports, and adjusted visibility.
.../serverpod_auth_user_server/lib/src/business/auth_users.dart Introduced AuthUsers class with static methods for CRUD operations and an extension for model conversion.
.../serverpod_auth_user_server/lib/src/models/auth_user_model.spy.yaml Added new data model definition for AuthUserModel.
.../serverpod_auth_user_server/lib/src/models/auth_user_not_found_exception.spy.yaml Added new exception definition for AuthUserNotFoundException.
.../serverpod_auth_user_server/lib/src/util/auth_user_scopes_extension.dart Changed extension to operate on AuthUserModel instead of AuthUser.
.../serverpod_auth_user_server/pubspec.yaml
templates/pubspecs/.../pubspec.yaml
Added clock and meta as dependencies; updated test dev dependency syntax.
.../serverpod_auth_user_server/test/integration/auth_users_test.dart Added integration tests for AuthUsers operations and error handling.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Endpoint
    participant AuthUsers
    participant Database

    Client->>Endpoint: Register or authenticate user
    Endpoint->>AuthUsers: create(session, ...)
    AuthUsers->>Database: Insert new AuthUser row
    Database-->>AuthUsers: New user data
    AuthUsers-->>Endpoint: AuthUserModel
    Endpoint-->>Client: Response with AuthUserModel

    Client->>Endpoint: Retrieve user by ID
    Endpoint->>AuthUsers: get(session, authUserId)
    AuthUsers->>Database: Query AuthUser by ID
    Database-->>AuthUsers: User data or not found
    AuthUsers-->>Endpoint: AuthUserModel or throw AuthUserNotFoundException
    Endpoint-->>Client: Response or error
Loading
sequenceDiagram
    participant Test
    participant TestUtils
    participant AuthUsers
    participant Database

    Test->>TestUtils: createAuthUser(session)
    TestUtils->>AuthUsers: create(session)
    AuthUsers->>Database: Insert new AuthUser row
    Database-->>AuthUsers: New user data
    AuthUsers-->>TestUtils: AuthUserModel
    TestUtils-->>Test: AuthUserModel
Loading

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai

coderabbitai Bot commented Jun 12, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@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: 3

🧹 Nitpick comments (6)
modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server/test/integration/authentication_handler_test.dart (1)

71-73: Consider extracting repeated “create temp user” logic into a test utility

AuthUsers.createAuthUser(session) followed by authUserId = authUser.id appears twice in this file (lines 71-73 & 157-159).
A tiny helper or a setUp callback would keep the tests DRY and remove duplication noise.

Also applies to: 157-159

modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/serverpod_auth_user_server.dart (1)

5-8: Minor wording nit – double “the” in comment

// We don't want to expose these, but have to for the the generated database code…

-// We don't want to expose these, but have to for the the generated database code in consuming packages.
+// We don't want to expose these, but have to for the generated database code in consuming packages.
modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/business/auth_users.dart (2)

28-46: createAuthUser – avoid unnecessary .nonNulls

scopes.map((s) => s.name) cannot contain null because Scope.name is non-nullable. The extra .nonNulls call is redundant and slightly obscures intent.

-        scopeNames: scopes.map((final s) => s.name).nonNulls.toSet(),
+        scopeNames: scopes.map((s) => s.name).toSet(),

51-86: No-op update results in a write

When both scopes and blocked are null, updateAuthUser still performs an updateRow round-trip, even though nothing changed.
A fast path returning early would trim an unnecessary DB call.

modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_client/lib/src/protocol/auth_user_model.dart (1)

99-105: copyWith unnecessarily reallocates scopeNames

this.scopeNames.map((e0) => e0).toSet() allocates even when scopeNames isn’t overridden.
You can simply reuse the existing reference – Set in Dart is already mutable-safe in this context.

-      scopeNames: scopeNames ?? this.scopeNames.map((e0) => e0).toSet(),
+      scopeNames: scopeNames ?? this.scopeNames,
modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/test/integration/auth_users_test.dart (1)

40-44: Assertion description typo

then its removed → then it is removed for grammatical clarity.

-    test('when deleting it, then its removed from the database.', () async {
+    test('when deleting it, then it is removed from the database.', () async {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7979b3d and 92ab850.

⛔ Files ignored due to path filters (3)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/generated/auth_user_model.dart is excluded by !**/generated/**
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/generated/auth_user_not_found_exception.dart is excluded by !**/generated/**
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/generated/protocol.dart is excluded by !**/generated/**
📒 Files selected for processing (15)
  • modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/src/endpoints/email_account_endpoint.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/test/test_utils.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server/test/integration/authentication_handler_test.dart (2 hunks)
  • modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_server/test/test_utils.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_client/lib/src/protocol/auth_user_model.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_client/lib/src/protocol/auth_user_not_found_exception.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_client/lib/src/protocol/protocol.dart (4 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/serverpod_auth_user_server.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/business/auth_users.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/models/auth_user_model.spy.yaml (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/models/auth_user_not_found_exception.spy.yaml (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/util/auth_user_scopes_extension.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/pubspec.yaml (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/test/integration/auth_users_test.dart (1 hunks)
  • templates/pubspecs/modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/pubspec.yaml (1 hunks)
🔇 Additional comments (15)
modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/models/auth_user_not_found_exception.spy.yaml (1)

1-1: Approve exception declaration.
AuthUserNotFoundException is correctly declared in the spy model, enabling code generation for missing-user errors.

modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/pubspec.yaml (2)

13-14: Approve new dependencies.
Adding clock (for timestamp management) and meta (for visibility annotations) supports the AuthUsers class.


20-20: Normalize dev dependency syntax.
Switching test to unquoted caret syntax aligns with the other version constraints.

templates/pubspecs/modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/pubspec.yaml (2)

12-13: Approve template dependencies.
Template pubspec now includes clock and meta placeholders for generated modules.


19-19: Normalize template test constraint.
Unquoted caret syntax for test in the template mirrors the actual pubspec format.

modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/models/auth_user_model.spy.yaml (5)

1-2: Approve model declaration.
The AuthUserModel class is properly defined with a fields section for code generation.


3-3: Approve id field.
UuidValue ensures each auth user has a unique identifier.


5-6: Approve created timestamp field.
The comment and DateTime type clearly represent creation time.


8-9: Approve scopeNames field.
Using Set<String> for scopes promotes de-duplication and clarity.


11-12: Approve blocked flag.
The boolean blocked field effectively signals sign-in restriction.

modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/util/auth_user_scopes_extension.dart (1)

4-5: Approve extension update.
Switching the doc comment and extension to target AuthUserModel aligns with the new abstraction.

modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_server/test/test_utils.dart (1)

4-8: Looks good – helper now uses the shared AuthUsers API

Creation is correctly delegated and the function type now matches the helper’s UuidValue return. Nothing else to flag.

modules/new_serverpod_auth/serverpod_auth_email/serverpod_auth_email_server/lib/src/endpoints/email_account_endpoint.dart (1)

121-124: Pass the active transaction to getAuthUser to stay inside the same DB txn

_createSession is invoked from within a session.db.transaction, yet AuthUsers.getAuthUser is called without the transaction: argument.
While Serverpod often reuses the current connection implicitly, being explicit avoids surprises (nested transactions, unexpected locking).

-    final authUser = await AuthUsers.getAuthUser(
-      session,
-      authUserId: authUserId,
-    );
+    final authUser = await AuthUsers.getAuthUser(
+      session,
+      authUserId: authUserId,
+      transaction: session.db.currentTransaction,
+    );

If getAuthUser already detects an open transaction automatically, please ignore; otherwise this shields us from subtle isolation bugs.

modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/test/integration/auth_users_test.dart (1)

46-51: Single-item assertion is brittle

listAuthUsers returning exactly one record assumes no previous leakage from other tests.
Safer to assert that the created authUser.id is contained in the result set.

-      expect(authUsers.single.id, authUser.id);
+      expect(authUsers.map((u) => u.id), contains(authUser.id));
modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_client/lib/src/protocol/auth_user_not_found_exception.dart (1)

40-49: LGTM – minimal, serializable marker exception

Implementation correctly satisfies both SerializableException and SerializableModel with no extraneous state.

@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.

LGTM!
Just have a single comment for discussion.

tp added 2 commits June 13, 2025 10:45
As we did practically already, just without explicit `show`

@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

🧹 Nitpick comments (2)
modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/business/auth_users.dart (2)

88-99: Consider exposing pagination / filtering for list

list() currently fetches all auth users in one query.
On a production system this can turn into an unbounded table scan and DOS-size response.

Expose optional limit, offset, or predicate parameters (e.g. blocked: bool?, scope: Scope?) to keep the method usable at scale.


79-86: Avoid needless write when nothing changes

If both scopes and blocked are null, the method still issues updateRow, producing a no-op write and an extra row-lock.

-    authUser = await AuthUser.db.updateRow(
-      session,
-      authUser,
-      transaction: transaction,
-    );
+    if (authUser != originalAuthUser) {
+      authUser = await AuthUser.db.updateRow(
+        session,
+        authUser,
+        transaction: transaction,
+      );
+    }

Keeps the DB quieter and eliminates a possible race.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3860eeb and 26cdeb6.

📒 Files selected for processing (2)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/business/auth_users.dart (1 hunks)
  • modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/test/integration/auth_users_test.dart (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (57)
  • GitHub Check: Version change test
  • GitHub Check: Flutter unit tests (3.24.0, windows-latest, packages/serverpod_flutter)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server with Flutter 3.32.1
  • GitHub Check: Flutter unit tests (3.32.1, windows-latest, packages/serverpod_flutter)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server with Flutter 3.32.1
  • GitHub Check: Flutter unit tests (3.32.1, ubuntu-latest, packages/serverpod_flutter)
  • GitHub Check: Serverpod integration tests (flutter)
  • GitHub Check: Unit tests IO (3.24.0, windows-latest)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_profile/serverpod_auth_profile_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in tests/serverpod_test_module/serverpod_test_module_server with Flutter 3.32.1
  • GitHub Check: Unit tests IO (3.24.0, ubuntu-latest)
  • GitHub Check: Unit tests IO (3.32.1, windows-latest)
  • GitHub Check: Unit tests IO (3.32.1, ubuntu-latest)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/serverpod_auth/serverpod_auth_server with Flutter 3.32.1
  • GitHub Check: Migration e2e tests (3.32.1)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_server with Flutter 3.24.0
  • GitHub Check: Serverpod E2E web tests (3.24.0)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_server with Flutter 3.32.1
  • GitHub Check: Migration e2e tests (3.24.0)
  • GitHub Check: Module integration tests in modules/serverpod_auth/serverpod_auth_server with Flutter 3.24.0
  • GitHub Check: dart analyze downgrade (3.32.1, windows-latest)
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_api_tokens/serverpod_auth_api_tokens_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.32.1
  • GitHub Check: Module integration tests in modules/new_serverpod_auth/serverpod_auth_jwt/serverpod_auth_jwt_server with Flutter 3.24.0
  • GitHub Check: Module integration tests in tests/serverpod_test_module/serverpod_test_module_server with Flutter 3.24.0
  • GitHub Check: Serverpod integration tests (server) (3.24.0)
  • GitHub Check: Module integration tests in tests/serverpod_test_nonvector/serverpod_test_nonvector_server with Flutter 3.24.0
  • GitHub Check: Unit tests Web (3.32.1, windows-latest)
  • GitHub Check: dart analyze latest (3.32.1, windows-latest)
  • GitHub Check: Unit tests Web (3.32.1, ubuntu-latest)
  • GitHub Check: Serverpod integration tests (server) (3.32.1)
  • GitHub Check: Serverpod integration tests (3.32.1, packages/serverpod_shared)
  • GitHub Check: dart analyze downgrade (3.32.1, ubuntu-latest)
  • GitHub Check: Serverpod E2E web tests (3.32.1)
  • GitHub Check: Unit tests Web (3.24.0, ubuntu-latest)
  • GitHub Check: dart analyze downgrade (3.24.0, windows-latest)
  • GitHub Check: update pubspecs (3.24.0)
  • GitHub Check: update pubspecs (3.32.1)
  • GitHub Check: CLI e2e tests (3.24.0, ubuntu-latest, tests/serverpod_cli_e2e_test)
  • GitHub Check: dart analyze latest (3.32.1, ubuntu-latest)
  • GitHub Check: Unit tests Web (3.24.0, windows-latest)
  • GitHub Check: dart analyze downgrade (3.24.0, ubuntu-latest)
  • GitHub Check: CLI e2e tests (3.32.1, ubuntu-latest, tests/serverpod_cli_e2e_test)
  • GitHub Check: serverpod generate (3.24.0)
  • GitHub Check: Serverpod concurrent integration tests (server) (3.32.1)
  • GitHub Check: Bootstrap tests (3.32.1, windows-latest, tests/bootstrap_project)
  • GitHub Check: Serverpod concurrent integration tests (server) (3.24.0)
  • GitHub Check: Bootstrap tests (3.24.0, ubuntu-latest, tests/bootstrap_project)
  • GitHub Check: Serverpod E2E IO tests (3.24.0)
  • GitHub Check: serverpod generate (3.32.1)
  • GitHub Check: Serverpod E2E IO tests (3.32.1)
  • GitHub Check: Bootstrap tests (3.24.0, windows-latest, tests/bootstrap_project)
  • GitHub Check: Bootstrap tests (3.32.1, ubuntu-latest, tests/bootstrap_project)
  • GitHub Check: dart analyze (3.24.0, windows-latest)
  • GitHub Check: dart analyze (3.24.0, ubuntu-latest)
🔇 Additional comments (4)
modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/lib/src/business/auth_users.dart (1)

109-118: Transaction correctly forwarded – nice catch

Forwarding the transaction argument to deleteWhere fixes the previously reported issue.

modules/new_serverpod_auth/serverpod_auth_user/serverpod_auth_user_server/test/integration/auth_users_test.dart (3)

5-5: Relative path import may break outside this folder

'./test_tools/serverpod_test_tools.dart' relies on the test runner’s working directory.
Prefer a package: import (package:serverpod_test_tools/serverpod_test_tools.dart) or a path relative to the package root to avoid IDE / CI resolution issues.


61-66: UUID helper import missing?

Uuid is used but not imported. Ensure either:

import 'package:uuid/uuid.dart';

or that serverpod re-exports Uuid.

Also applies to: 71-76, 79-84


13-38: Good coverage of core CRUD paths

The tests validate default values, update semantics, listing and deletion – a solid baseline.

Also applies to: 40-50

@tp
tp merged commit 26d2aef into serverpod:main Jun 13, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 13, 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