build: Serverpod v4.0.3

Moves every Serverpod package, and the four overrides for serverpod_offline_sync, from v4.0.2 to v4.0.3 before the first synced table's migration exists, so that migration is created on the version that stays.

v4.0.3 contains fixes only. Checked before moving: serverpod_database gained only backwards-compatible changes, none of which the sync package calls into. Server-side session keys are hashed as before (the cheaper argon2 applies to JWT refresh tokens, which we don't use), so no session ends. The auth module's profile image relation is now deferred, which fixes restoring a Postgres dump; step 7's migration carries that change.

argon2 now runs in serverpod_argon2 (BSD-3), a new dependency of the server only: a prebuilt, statically linked library that needs no glibc, bundled by dart build cli like the SQLite libraries, so the Docker build is unchanged. It doesn't reach the app.

The code generator still fails on Dart v3.13's primary constructors in endpoint files (tried again), so the server keeps the four syntax lints off. The regenerated test tools gain withServerpod's ephemeralDatabase option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-09-30 10:42:34 +02:00
commit 12fa00de17
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
3 changed files with 63 additions and 46 deletions

View file

@ -6,10 +6,11 @@ analyzer:
- lib/src/generated/**
- test/integration/test_tools/serverpod_test_tools.dart
# Serverpod v4.0.2's code generator reads this package with an analyzer that doesn't
# know Dart v3.13's primary constructors yet, and fails on them ("requires the
# 'primary-constructors' language feature"). So the server keeps the classic
# constructor and class-body syntax; switch these back on once Serverpod parses it.
# Serverpod's code generator reads this package with an analyzer that doesn't know
# Dart v3.13's primary constructors yet, and fails on them in endpoint files ("requires
# the 'primary-constructors' language feature"; checked again with v4.0.3). So the
# server keeps the classic constructor and class-body syntax; switch these back on once
# Serverpod parses it.
linter:
rules:
empty_container_bodies: false

View file

@ -9,11 +9,11 @@ environment:
resolution: workspace
dependencies:
serverpod: 4.0.2
serverpod_auth_idp_server: 4.0.2
serverpod: 4.0.3
serverpod_auth_idp_server: 4.0.3
serverpod_offline_sync_server: 0.0.8
dev_dependencies:
serverpod_test: 4.0.2
serverpod_test: 4.0.3
test: ^1.25.5
serverpod:

View file

@ -42,6 +42,9 @@ export 'package:serverpod_test/serverpod_test_public_exports.dart';
///
/// [enableSessionLogging] Whether session logging should be enabled. Defaults to `false`
///
/// [ephemeralDatabase] Whether this group gets its own empty database, created when the group starts and dropped when it finishes. Defaults to `true`.
/// Set this to `false` to use the database configured for [runMode], including a previously seeded database. [configOverride] can still replace that database. The configured database is not created or dropped, so groups that share it cannot run in parallel. [rollbackDatabase] still controls whether writes inside the group are rolled back.
///
/// [rollbackDatabase] Options for when to rollback the database during the test lifecycle.
/// By default `withServerpod` does all database operations inside a transaction that is rolled back after each `test` case.
/// Just like the following enum describes, the behavior of the automatic rollbacks can be configured:
@ -111,6 +114,7 @@ void withServerpod(
_is.ServerpodConfig Function(_is.ServerpodConfig)? configOverride,
_is.DatabaseInterceptor? databaseInterceptor,
bool? enableSessionLogging,
bool? ephemeralDatabase,
_is.ExperimentalFeatures? experimentalFeatures,
_ist.RollbackDatabase? rollbackDatabase,
String? runMode,
@ -129,6 +133,7 @@ void withServerpod(
serializationManager: Protocol(),
runMode: runMode,
applyMigrations: applyMigrations,
ephemeralDatabase: ephemeralDatabase,
isDatabaseEnabled: true,
serverpodLoggingMode: serverpodLoggingMode,
testServerOutputMode: testServerOutputMode,