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
8 changed files with 63 additions and 46 deletions

View file

@ -63,7 +63,7 @@ A spaced-repetition learning app: studysets of flashcards, reviewed on an FSRS s
- Every decision carries its reason (in `NEXT.md` or an ADR under `docs/adr/`).
- **Commits** are GPG-signed and carry a DCO `Signed-off-by` trailer (`git commit -s`; a local `prepare-commit-msg` hook adds it automatically).
- **Pushes** pass `tool/check.sh` first, through a local `pre-push` hook (in a fresh clone: `ln -s ../../tool/check.sh .git/hooks/pre-push`).
- **Lints**: LeanCode's strict set (`leancode_lint`), configured once in the root `analysis_options.yaml`, which also enables its analyzer plugin. Plugins can only be enabled at the root of a pub workspace and only reach packages whose options include that file, so the server and the app include it; the generated client doesn't. Every `// ignore:` gets a comment saying why (`document_ignores`). The server switches off the four rules for Dart v3.13's constructor syntax (`use_primary_constructors`, `use_declaring_parameters`, `empty_container_bodies`, `unnecessary_type_name_in_constructor`): Serverpod v4.0.2's code generator can't parse that syntax yet.
- **Lints**: LeanCode's strict set (`leancode_lint`), configured once in the root `analysis_options.yaml`, which also enables its analyzer plugin. Plugins can only be enabled at the root of a pub workspace and only reach packages whose options include that file, so the server and the app include it; the generated client doesn't. Every `// ignore:` gets a comment saying why (`document_ignores`). The server switches off the four rules for Dart v3.13's constructor syntax (`use_primary_constructors`, `use_declaring_parameters`, `empty_container_bodies`, `unnecessary_type_name_in_constructor`): Serverpod's code generator (checked with v4.0.3) can't parse that syntax in endpoint files yet.
## App architecture

View file

@ -7,6 +7,6 @@ environment:
resolution: workspace
dependencies:
serverpod_auth_idp_client: 4.0.2
serverpod_client: 4.0.2
serverpod_auth_idp_client: 4.0.3
serverpod_client: 4.0.3
serverpod_offline_sync_client: 0.0.8

View file

@ -40,8 +40,8 @@ dependencies:
material_ui: ^1.5.0
path: ^1.9.1
path_provider: ^2.1.6
serverpod_auth_idp_flutter: 4.0.2
serverpod_flutter: 4.0.2
serverpod_auth_idp_flutter: 4.0.3
serverpod_flutter: 4.0.3
serverpod_offline_sync_client: 0.0.8
dev_dependencies:

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,

View file

@ -1114,98 +1114,106 @@ packages:
dependency: "direct overridden"
description:
name: serverpod
sha256: "5de0b0c9ac5ebcba3d71e171382f4051352cf4af5ff475c5fa660d325d52c237"
sha256: f98517ca2d7d2c834d9891f7ed13a46022c3260f10515b89090c15882ea5ed8f
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_argon2:
dependency: transitive
description:
name: serverpod_argon2
sha256: bc38946561c556693f8802e4f590761773e5a139346f2e9c9542c936ca706a8f
url: "https://pub.dev"
source: hosted
version: "0.1.0"
serverpod_auth_core_client:
dependency: transitive
description:
name: serverpod_auth_core_client
sha256: fc39c05142c6edcfe0d624e5370af1ba8311bbebdf55f6f9a2011927454ab059
sha256: cb21124db2bdcecbdb6405ee0f8f8c802787bae1ae08faced7b3ba9b3aa74a9d
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_auth_core_flutter:
dependency: transitive
description:
name: serverpod_auth_core_flutter
sha256: "60bed29b587f3ac8a7454cbfd2a7009678f84b3cf98207ddd994d35f37902592"
sha256: df14e6448db79781fb57bc1a521ef12ef788e4a096a1e3d322a1da038ec636b5
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_auth_core_server:
dependency: transitive
description:
name: serverpod_auth_core_server
sha256: "35d9426a0394f748282d8e7ab6ba81e142c0ef0213c6839b86813764024137db"
sha256: f06d5001f5349bc1b9310e29465320e540bd5f872aaf7efa1dfc3e1c6a5b7e60
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_auth_idp_client:
dependency: transitive
description:
name: serverpod_auth_idp_client
sha256: "0f23650e314d23aa6a3e4c46d91e5d922137de00f49f637b9d1c9c08599b6846"
sha256: "8d122d71d4a79be3441f0e5ded7dd566cb3cd14b164a23ff56f82f2a640e51a3"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_auth_idp_flutter:
dependency: transitive
description:
name: serverpod_auth_idp_flutter
sha256: "0800435b8b25eb23bf8b9ec03fb15ddd412db9fb2d5ed7f0d36e424a8bdc03ad"
sha256: "5845051159001ceddccb5052053538f6e468ca525fffe80b79b1e5c693de42a5"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_auth_idp_server:
dependency: transitive
description:
name: serverpod_auth_idp_server
sha256: "10d5c24dbc48f3c658647e0fd6c3c94cd59dbfb02e611c82ca8a2060fdac30de"
sha256: e03fc76028fb848f2600b8721635ac35e2fff8c2a6dbd5e076e15a692b4a1263
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_client:
dependency: "direct overridden"
description:
name: serverpod_client
sha256: "85ed6639f7b4acd7d39eba63e8213195561eed48a3333dc9a146281db6a189ae"
sha256: "7e8df97e386635ddc8a838af890100a98814170aa118d6245918ad0e2cf160bb"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_database:
dependency: "direct overridden"
description:
name: serverpod_database
sha256: b27f7182251c5aca49d5285b9885025b5520498ff447cd101f06b9ca6dff1a17
sha256: "761463ecb24201fa5743f9938e4bc20b0c29a35c0a03d1ee36085f6f57a76eb5"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_embedded_postgres:
dependency: transitive
description:
name: serverpod_embedded_postgres
sha256: eb64e6839eb46ca56bf20ce8b56b22a25a6b2d30f8288632c2e8d0f8c1f3bf12
sha256: f98b685137b74b767097131cc93da4881ff9c2184e5eb85c63b923122a26fdd1
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_flutter:
dependency: transitive
description:
name: serverpod_flutter
sha256: "6e7275e91b139bebdaac53de8eb25bf073810944bd62db349fbaca312bafe1c6"
sha256: f8d975c5bd6bf6835bd5ecbd6badff7691b06b42c9ccff2bfe604b037e4634a1
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_lints:
dependency: transitive
description:
name: serverpod_lints
sha256: be65ef9f9cf12c4859e5c125553cc9ed4b58d1807de324e0bceaeb7e62c8b459
sha256: c1d6a338e98249c9f6954466cb5762d81013917234c60f030a4ff8d4b99dd9a3
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_logging:
dependency: transitive
description:
@ -1242,26 +1250,26 @@ packages:
dependency: "direct overridden"
description:
name: serverpod_serialization
sha256: c9882640744d2308081b3e7c1b4bf962f502105b14754317e002ccbf748850f2
sha256: "35f02a34ef6843d5d5077fe3829ece5c7226dc53a4ebe9c1a2da563a3ccce1d1"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_shared:
dependency: transitive
description:
name: serverpod_shared
sha256: cef446025a81fab62a3636ea59d0a953a3ee0cd2741c1264377ae98838743a27
sha256: "99e1e2ee568d9e00cedf8ff0b9d22a330a0c4f999e9fe156ec3d8519a30417fe"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
serverpod_test:
dependency: transitive
description:
name: serverpod_test
sha256: ad65258e28812e3d43e101546f7ce878fc34828517af7305b5eba8c05f89e853
sha256: "9e4416c99971b4736e76696efd48232dca735c7d7f9fc1329d0b0f171640fa5b"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
shelf:
dependency: transitive
description:

View file

@ -19,8 +19,11 @@ dev_dependencies:
# pin is conservative (serverpod_database v4.0.0 and v4.0.2 have identical lib/, and sync
# works on v4.0.2), so these four keep the whole workspace on the Serverpod we run. Every
# Serverpod upgrade re-checks them until the package widens its constraints (ADR 0001).
# v4.0.3 checked: serverpod_database only gained backwards-compatible changes (custom SQL
# defaults tolerated, an optional ignoreDefault on column comparison, a laxer integrity
# check for unmanaged tables), none of which the sync package calls into.
dependency_overrides:
serverpod: 4.0.2
serverpod_client: 4.0.2
serverpod_database: 4.0.2
serverpod_serialization: 4.0.2
serverpod: 4.0.3
serverpod_client: 4.0.3
serverpod_database: 4.0.3
serverpod_serialization: 4.0.3