Repository navigation
feat(auth2): Add client SessionManager for serverpod_auth_session - #3721
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 📝 WalkthroughWalkthroughA new Flutter package, Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant SessionManager
participant KeyValueStorage
participant SharedPreferences
App->>SessionManager: init()
SessionManager->>KeyValueStorage: get(sessionKey)
KeyValueStorage->>SharedPreferences: getString(sessionKey)
SharedPreferences-->>KeyValueStorage: sessionKeyValue
KeyValueStorage-->>SessionManager: sessionKeyValue
SessionManager-->>App: Initialization complete
App->>SessionManager: setLoggedIn(AuthSuccess)
SessionManager->>KeyValueStorage: set(sessionKey, value)
KeyValueStorage->>SharedPreferences: setString(sessionKey, value)
SharedPreferences-->>KeyValueStorage: success
KeyValueStorage-->>SessionManager: success
App->>SessionManager: logout()
SessionManager->>KeyValueStorage: set(sessionKey, null)
KeyValueStorage->>SharedPreferences: remove(sessionKey)
SharedPreferences-->>KeyValueStorage: success
KeyValueStorage-->>SessionManager: success
SessionManager-->>App: Session cleared
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
SessionManager for serverpod_auth_sessionSessionManager for serverpod_auth_session
b9449e4 to
3d83790
Compare
3d83790 to
3e8e067
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Implemented as package `serverpod_auth_session_flutter`
3e8e067 to
ade2102
Compare
nielsenko
left a comment
There was a problem hiding this comment.
LGTM 🚀 I have some suggestions you can consider
🤔 Not sure why that stalled. Try just: |
|
Tip For best results, initiate chat on the files or code changes. Unable to process this comment: maximum number of iterations reached. 🧩 Analysis chain@nielsenko I'll trigger a review for you right away! Let me gather the information about the changes in this PR and conduct a thorough review. 🏁 Script executed: Length of output: 748 🏁 Script executed: Length of output: 2405 🏁 Script executed: Length of output: 7792 🏁 Script executed: Length of output: 5809 🏁 Script executed: Length of output: 7517 @nielsenko Here's my comprehensive review of PR #3721 that adds the new client ✅ Overall AssessmentThis is a well-designed implementation that successfully modernizes the session management approach. The architecture is clean, with good separation of concerns and comprehensive test coverage. 🐛 Issues Found1. Critical: Missing UUID Import in Tests// In test file - these lines will cause compilation errors:
SessionManagerStorageKeys.authUserIdStorageKey: const Uuid().v4(),
authUserId: const Uuid().v4obj(),The test file uses 2. Bug: Missing AuthInfo Update in setLoggedInFuture<void> setLoggedIn(AuthSuccess authSuccess) async {
_key = authSuccess.sessionKey;
// ... storage operations
// Missing: _authInfo.value = (authUserId: ..., scopeNames: ...);
}The 3. Race Condition: Unawaited Storage Operations// These should be awaited:
_secureStorage.set(/*...*/); // Missing await
_storage.set(/*...*/); // Missing await
_storage.set(/*...*/); // Missing await4. Minor: Typo in Test Variablefinal _authSucces = AuthSuccess(/*...*/); // Should be _authSuccess✨ Strengths
🔧 Suggested Fixes// Fix setLoggedIn method:
Future<void> setLoggedIn(AuthSuccess authSuccess) async {
_key = authSuccess.sessionKey;
await _secureStorage.set(
SessionManagerStorageKeys.sessionKeyStorageKey,
authSuccess.sessionKey,
);
await _storage.set(
SessionManagerStorageKeys.authUserIdStorageKey,
authSuccess.authUserId.uuid,
);
await _storage.set(
SessionManagerStorageKeys.scopeNamesStorageKey,
jsonEncode(authSuccess.scopeNames.toList()),
);
// Update the auth info notifier
_authInfo.value = (
authUserId: authSuccess.authUserId,
scopeNames: authSuccess.scopeNames,
);
}// Add to test file imports:
import 'package:uuid/uuid.dart';
// Fix typo:
final _authSuccess = AuthSuccess(/*...*/);The implementation follows good Flutter/Dart patterns and will be a solid foundation for the new auth system. The issues are straightforward to fix and don't impact the overall architecture. 🤖 🏁 Script executed: Length of output: 1052 🏁 Script executed: Length of output: 1117 🏁 Script executed: Length of output: 847 🏁 Script executed: Length of output: 2857 🏁 Script executed: Length of output: 2152 |
|
@CodeRabbit full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (4)
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/src/key_value_storage.dart (1)
8-10: Specify the return type forsetto avoiddynamicleakageReturning bare
FutureOrimplicitly makes the resolved typedynamic.
Declare it asFutureOr<void>for clearer intent and stronger static checks.- FutureOr set(String key, String? value); + FutureOr<void> set(String key, String? value);modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/src/shared_preferences_key_value_storage.dart (2)
2-3: Use a package-private import to avoid unnecessary public-API couplingImporting the top-level library drags all re-exports and risks circular deps if it later re-exports this file.
Instead import the interface directly:-import 'package:serverpod_auth_session_flutter/serverpod_auth_session_flutter.dart'; +import '../src/key_value_storage.dart';
8-23: Minor perf: cacheSharedPreferencesinstead of fetching each call
SharedPreferences.getInstance()hits platform code every time.
A simple static cache avoids the overhead and still respects its singleton nature.class SharedPreferencesKeyValueStorage implements KeyValueStorage { + static final Future<SharedPreferences> _prefsFuture = + SharedPreferences.getInstance(); @override Future<String?> get(String key) async { - final prefs = await SharedPreferences.getInstance(); + final prefs = await _prefsFuture; return prefs.getString(key); } @override Future<void> set(String key, String? value) async { - final prefs = await SharedPreferences.getInstance(); + final prefs = await _prefsFuture; if (value == null) { await prefs.remove(key); } else { await prefs.setString(key, value); } } }modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/test/serverpod_auth_session_flutter_test.dart (1)
193-197: Fix typo in variable name.The variable
_authSuccesis missing the final 's' and should be_authSuccess.-final _authSucces = AuthSuccess( +final _authSuccess = AuthSuccess( sessionKey: 'session-key', authUserId: const Uuid().v4obj(), scopeNames: {'test1', 'test2'}, );Note: You'll also need to update all references to this variable throughout the test file (lines 24, 30, 32, 67, 72).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/.gitignore(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/.metadata(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/CHANGELOG.md(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/README.md(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/analysis_options.yaml(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/serverpod_auth_session_flutter.dart(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/src/key_value_storage.dart(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/src/session_manager.dart(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/src/shared_preferences_key_value_storage.dart(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/pubspec.yaml(1 hunks)modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/test/serverpod_auth_session_flutter_test.dart(1 hunks)templates/pubspecs/modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/pubspec.yaml(1 hunks)util/pub_get_all(1 hunks)util/run_tests_analyze(1 hunks)util/update_pubspecs(2 hunks)
🧰 Additional context used
🧠 Learnings (15)
📓 Common learnings
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
Learnt from: tp
PR: serverpod/serverpod#3651
File: modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts.dart:35-39
Timestamp: 2025-06-16T12:07:26.018Z
Learning: The `withServerpod` test helper runs tests within a transaction, which may require adapting database queries to accept transaction parameters for proper snapshot consistency during testing.
Learnt from: tp
PR: serverpod/serverpod#3651
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart:1-1
Timestamp: 2025-06-19T11:00:17.085Z
Learning: In Serverpod applications, methods that rely on public asset storage (like setUserImage/removeUserImage) should be tested in E2E tests rather than withServerpod integration tests, as they require a full server environment with asset storage infrastructure to properly test image upload/download functionality.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
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.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/analysis_options.yaml (3)
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/.metadata (5)
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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
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:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
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:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
util/run_tests_analyze (5)
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
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.
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:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
Learnt from: tp
PR: serverpod/serverpod#3651
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart:1-1
Timestamp: 2025-06-19T11:00:17.085Z
Learning: In Serverpod applications, methods that rely on public asset storage (like setUserImage/removeUserImage) should be tested in E2E tests rather than withServerpod integration tests, as they require a full server environment with asset storage infrastructure to properly test image upload/download functionality.
util/pub_get_all (6)
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:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
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:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
Learnt from: tp
PR: serverpod/serverpod#3651
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart:1-1
Timestamp: 2025-06-19T11:00:17.085Z
Learning: In Serverpod applications, methods that rely on public asset storage (like setUserImage/removeUserImage) should be tested in E2E tests rather than withServerpod integration tests, as they require a full server environment with asset storage infrastructure to properly test image upload/download functionality.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/README.md (8)
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
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.
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:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
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:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
Learnt from: tp
PR: serverpod/serverpod#3651
File: modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts.dart:35-39
Timestamp: 2025-06-16T12:07:26.018Z
Learning: The `withServerpod` test helper runs tests within a transaction, which may require adapting database queries to accept transaction parameters for proper snapshot consistency during testing.
Learnt from: tp
PR: serverpod/serverpod#3651
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart:1-1
Timestamp: 2025-06-19T11:00:17.085Z
Learning: In Serverpod applications, methods that rely on public asset storage (like setUserImage/removeUserImage) should be tested in E2E tests rather than withServerpod integration tests, as they require a full server environment with asset storage infrastructure to properly test image upload/download functionality.
Learnt from: exaby73
PR: serverpod/serverpod#3619
File: packages/serverpod/test/server/command_line_args_test.dart:220-250
Timestamp: 2025-06-12T12:35:56.188Z
Learning: `CommandLineArgs` in Serverpod is intentionally designed so that if any CLI argument is invalid, the parser discards all parsed values and falls back to the built-in defaults, while emitting a log message. Maintainers consider this acceptable and do not plan to change it.
util/update_pubspecs (4)
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:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
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:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/src/shared_preferences_key_value_storage.dart (1)
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/.gitignore (4)
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:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
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.
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:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
templates/pubspecs/modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/pubspec.yaml (4)
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.
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
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:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/serverpod_auth_session_flutter.dart (1)
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/pubspec.yaml (5)
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.
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:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
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:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/test/serverpod_auth_session_flutter_test.dart (3)
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
Learnt from: tp
PR: serverpod/serverpod#3651
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart:1-1
Timestamp: 2025-06-19T11:00:17.085Z
Learning: In Serverpod applications, methods that rely on public asset storage (like setUserImage/removeUserImage) should be tested in E2E tests rather than withServerpod integration tests, as they require a full server environment with asset storage infrastructure to properly test image upload/download functionality.
Learnt from: tp
PR: serverpod/serverpod#3651
File: modules/new_serverpod_auth/serverpod_auth_email_account/serverpod_auth_email_account_server/lib/src/business/email_accounts.dart:35-39
Timestamp: 2025-06-16T12:07:26.018Z
Learning: The `withServerpod` test helper runs tests within a transaction, which may require adapting database queries to accept transaction parameters for proper snapshot consistency during testing.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/CHANGELOG.md (7)
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.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/README.md:3-8
Timestamp: 2025-06-17T11:34:13.289Z
Learning: The README.md files in the serverpod_auth_migration module directories are auto-generated and get overwritten by utility scripts, so manual updates should be avoided until proper documentation is added during feature rollout.
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:44:37.288Z
Learning: Changes to README.md and CHANGELOG.md files made by the util/update_pubspecs script can be safely ignored during code review, as these files are auto-generated by copying from a single source rather than being manually authored.
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
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:44:37.288Z
Learning: The util/update_pubspecs script automatically copies the root CHANGELOG.md to all packages/modules and README_subpackage.md to all modules as README.md. These file changes should be ignored during code review as they are auto-generated distribution of shared content, not manual authoring that requires review.
Learnt from: tp
PR: serverpod/serverpod#3651
File: tests/serverpod_new_auth_test/serverpod_new_auth_test_server/test/integration/email_account_endpoint_test.dart:1-1
Timestamp: 2025-06-19T11:00:17.085Z
Learning: In Serverpod applications, methods that rely on public asset storage (like setUserImage/removeUserImage) should be tested in E2E tests rather than withServerpod integration tests, as they require a full server environment with asset storage infrastructure to properly test image upload/download functionality.
Learnt from: tp
PR: serverpod/serverpod#3666
File: modules/new_serverpod_auth/serverpod_auth_migration/serverpod_auth_migration_server/lib/src/business/auth_migration_email.dart:0-0
Timestamp: 2025-06-17T13:04:19.522Z
Learning: In serverpod_auth_migration profile image migration, the image must be fetched from the URL rather than just copying the URL because the database schema requires storing the storage bucket and relative path information in addition to the public URL. This storage information is necessary for proper cleanup when profiles are deleted. The fetch approach works fine in production but requires localhost exclusion in testing environments where no HTTP file server is running.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/src/session_manager.dart (1)
Learnt from: tp
PR: serverpod/serverpod#3672
File: tests/serverpod_test_server/test_integration/test_tools/test_session_builder_test.dart:10-30
Timestamp: 2025-06-18T14:49:11.263Z
Learning: In Serverpod test files, tp prefers using nullable late variables for AuthenticationInfo in tests (e.g., `late AuthenticationInfo? authenticationInfo;`) rather than non-nullable ones to avoid using `!` operators and to get clearer error messages when authentication setup fails. This provides better diagnostics when `session.authenticated` returns null.
🪛 LanguageTool
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/CHANGELOG.md
[style] ~8-~8: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...nment variables in the auth module. - feat(EXPERIMENTAL): Adds support for registe...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~52-~52: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ng a default value for Enum models. - feat(EXPERIMENTAL): Adds support for attachi...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~63-~63: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ort for non-nullable Set in models. - fix(EXPERIMENTAL): Includes Uri path in dia...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~64-~64: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...cludes Uri path in diagnostic events. - fix(EXPERIMENTAL): Reports diagnostic event...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~74-~74: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...OD_SERVER_ID` environmental variable. - feat(EXPERIMENTAL): Adds support for excepti...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~75-~75: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...iagnostic events to monitoring tools. - feat(EXPERIMENTAL): Adds API for submitting ...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~105-~105: Consider using a different verb for a more formal wording.
Context: ...in different modules. ## 2.2.1 - fix: Fixes an issue where invalid Dart import path...
(FIX_RESOLVE)
[style] ~139-~139: It’s more common nowadays to write this noun as one word.
Context: ...## 2.1.2 - fix: Supports updating full user name in auth module. - fix: Adds missing tr...
(RECOMMENDED_COMPOUNDS)
[misspelling] ~167-~167: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...endpoint methods. - feat: When sending a HTTP 400 Bad Request error message to t...
(EN_A_VS_AN)
[uncategorized] ~167-~167: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...rror message may now be included in the client side exception. - fix: Allows Serverpod def...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[uncategorized] ~180-~180: The preposition ‘to’ seems more likely in this position.
Context: ...es iss value for all possible domains in Sign in with Google. - fix: Add `metho...
(AI_HYDRA_LEO_REPLACE_IN_TO)
[duplication] ~190-~190: Possible typo: you repeated a word.
Context: ... db storage. - fix: Adds logging for when when uploads to buckets fail. - fix: Remove...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~214-~214: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... fix: Adds explicit exception types for client side exceptions. - fix: Correctly sets offse...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[style] ~230-~230: It’s more common nowadays to write this noun as one word.
Context: ...llToJson method. - fix: BREAKING. Makes user name nullable in UserInfo. - fix: BREAKING...
(RECOMMENDED_COMPOUNDS)
[grammar] ~246-~246: The operating system from Apple is written “macOS”.
Context: ...le. - feat: Adds client entitlements to MacOS after creating Flutter project. - fix: ...
(MAC_OS)
[uncategorized] ~324-~324: The verb “is” doesn’t seem to fit in this context, “are” is probably more formally correct.
Context: ...ions for updating from 1.1 of Serverpod is available in our documentation [here](h...
(AI_HYDRA_LEO_CPT_IS_ARE)
[style] ~334-~334: Consider using “outdated” to strengthen your wording.
Context: ...ser to update Serverpod when running an old version of the CLI. - feat: Improves ex...
(OLD_VERSION)
[grammar] ~406-~406: The auxiliary verb ‘do’ requires the base form of the verb.
Context: ...if the referenced parent table does not exists. - fix: Report an error if the table na...
(DID_BASEFORM)
[uncategorized] ~432-~432: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...Map values. - fix: Restrict length of user defined Postgres identifier names. ### Insight...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[style] ~451-~451: Consider a more concise word here.
Context: ... sign in button. - fix: Require consent in order to generate refresh token for Google Signi...
(IN_ORDER_TO_PREMIUM)
[uncategorized] ~468-~468: Possible missing comma found.
Context: ...` option to yaml-files, which is set to true will prevent the code to be generated f...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~471-~471: This word is normally spelled as one.
Context: ...s in Relic. - feat: Allows endpoints in sub directories. - feat: Support for GCP Cloud Storage....
(EN_COMPOUNDS_SUB_DIRECTORIES)
[uncategorized] ~493-~493: Loose punctuation mark.
Context: ...pose` ## 1.0.0 - First stable release! :D - Fixes incorrectly set database index...
(UNLIKELY_OPENING_PUNCTUATION)
[misspelling] ~506-~506: This word is normally spelled as one.
Context: .../discussions/567) ## 0.9.21 - Supports sub directories for protocol class files. - Updates dep...
(EN_COMPOUNDS_SUB_DIRECTORIES)
[grammar] ~535-~535: After the number ‘404’, use a plural noun. Did you mean “codes”?
Context: ... ## 0.9.15 - Correctly sets 404 return code if no route is matched in Relic web ser...
(CD_NNU)
[uncategorized] ~562-~562: The preposition ‘of’ seems more likely in this position.
Context: ...es the serverpod run command in favor for continuous generation. - Updates depend...
(AI_HYDRA_LEO_REPLACE_FOR_OF)
[uncategorized] ~575-~575: Possible missing comma found.
Context: ...urces. Most notably, only uses one load balancer which will fit within AWS free tier. - ...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~590-~590: The word ‘install’ is not a noun.
Context: ...w working on Windows. Tested on a fresh install of Windows 10. ## 0.9.6 - Improved, bu...
(A_INSTALL)
🪛 markdownlint-cli2 (0.17.2)
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/CHANGELOG.md
43-43: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
44-44: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
45-45: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
102-102: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
105-105: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
108-108: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
109-109: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
110-110: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
111-111: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
112-112: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
113-113: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
114-114: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
115-115: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
116-116: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
117-117: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
118-118: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
119-119: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
120-120: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
121-121: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
124-124: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
125-125: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
126-126: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
129-129: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
130-130: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
131-131: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
132-132: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
133-133: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
136-136: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
139-139: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
140-140: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
141-141: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
142-142: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
143-143: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
146-146: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
147-147: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
150-150: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
151-151: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
152-152: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
153-153: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
154-154: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
155-155: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
156-156: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
157-157: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
158-158: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
159-159: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
160-160: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
161-161: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
162-162: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
163-163: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
164-164: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
165-165: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
166-166: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
167-167: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
168-168: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
169-169: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
170-170: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
171-171: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
172-172: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
173-173: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
174-174: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
175-175: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
176-176: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
177-177: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
178-178: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
179-179: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
180-180: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
181-181: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
182-182: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
183-183: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
184-184: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
185-185: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
186-186: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
187-187: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
188-188: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
189-189: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
190-190: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
191-191: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
192-192: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
193-193: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
🔇 Additional comments (13)
util/run_tests_analyze (1)
58-62: Path addition looks correctIncluding the new Flutter package in static analysis ensures
dart analyzecovers the freshly added code.
No further action required.modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/analysis_options.yaml (1)
1-1: Lint configuration acknowledgedPointing to
serverpod_lints/public_flutter.yamlkeeps lint rules consistent with the rest of the mono-repo.
LGTM.modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/.metadata (1)
6-10: Metadata file – no manual changes expected
.metadatais auto-generated by Flutter tooling; nothing to review here.util/update_pubspecs (2)
61-64: Copy statements added correctlyCHANGELOG entry for the new Flutter package is now synced the same way as other modules – looks good.
116-118: README sync line mirrors CHANGELOG updateThe README copy line for the new package matches existing conventions.
No issues.modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/README.md (1)
3-9: No action required – auto-generated READMEContent looks standard and is most likely produced by the
util/update_pubspecsscript.
Nothing to review here.modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/.gitignore (1)
1-30: Git-ignore rules look goodCovers common OS, IDE and Flutter artefacts – nothing to add.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/lib/serverpod_auth_session_flutter.dart (1)
1-7: Re-exports are clean and minimalPublic surface is well-scoped; no issues spotted.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/pubspec.yaml (1)
1-38: Auto-generated pubspec.yaml looks correct.The dependencies and configuration are appropriate for a Flutter authentication session package. Since this is generated from a template, any changes should be made to the template file.
templates/pubspecs/modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/pubspec.yaml (1)
1-37: Template pubspec.yaml is well-structured.The template correctly defines the package dependencies and uses appropriate placeholders for version substitution. The dependency choices are suitable for a Flutter authentication session management package.
modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/CHANGELOG.md (1)
1-666: Auto-generated changelog - no review needed.Based on the retrieved learnings, CHANGELOG.md files are auto-generated by the
util/update_pubspecsscript and should be ignored during code review as they are copied from a single source rather than manually authored.modules/new_serverpod_auth/serverpod_auth_session/serverpod_auth_session_flutter/test/serverpod_auth_session_flutter_test.dart (2)
166-191: Well-designed test storage implementation.The
TestStorageclass provides a clean in-memory implementation ofKeyValueStoragethat's perfect for unit testing. ThesetTestValues()helper method is particularly useful for setting up test scenarios.
8-163: Comprehensive test coverage with well-organized structure.The test suite provides excellent coverage of the
SessionManagerfunctionality:
- Multiple storage configurations (single vs split storage)
- Error conditions (incomplete storage, repeated initialization)
- Full lifecycle testing (init, login, get, logout)
- Proper async/await handling throughout
The group-based organization makes the tests easy to understand and maintain.
(This probably did not show up yet due to the sync storage interface used in testing…)
(Before it was only set after `init`)
… in `pub_get_all` script
…e have a guaranteed consistent behavior across them
Add lint that Future's must be awaited Ensure test storage only writes "on next tick", such that unawaited storage issues are also visible in tests (and don't just rely on the linter)
As otherwise any string generates some UUID value Gleamed from serverpod#3721 which was having the same issue
As otherwise any string generates some UUID value Gleamed from serverpod#3721 which was having the same issue
As otherwise any string generates some UUID value Gleamed from serverpod#3721 which was having the same issue
Implemented as package
serverpod_auth_session_flutter.Add a simple "session manager" to be given to the Serverpod
Client(to retrieve the auth key for the next request).Unlike the legacy one in
serverpod_auth, this one does not handle the sign out itself, but rather relies on being notified of a logout (just like both of them do for a login).Like the legacy variant, this takes 2 storages: One "secure" one (just for the session key), and a default one for user info (ID and scopes for now). Hopefully, this is a bit clearer in this implementation.
By default only 1 store is used for both cases, which are backed by
shared_preferences.(In the legacy module there were 2 slightly distinct instances, but in the end both would also write into
shared_preferencesby default.)In the future we could replace the "secure" one with a Keychain etc. implementation.
This is only a minimal implementation to get started in the current version. In the future the storage interface should be slightly reworked for 3.0 as outlined in #3713.
The newly added
ValueListenable<AuthInfo?>(replacing the entire session manager being aChangeNotifierbefore) will fix #1651, and only notify the outside when the login status actually changed.Summary by CodeRabbit
New Features
serverpod_auth_session_flutterpackage, providing user session management and authentication capabilities for Flutter apps using Serverpod.SessionManagerfor handling session state, login, and logout, with support for persistent storage via shared preferences.Documentation
Tests
Chores