diff --git a/packages/serverpod_test/lib/serverpod_test_public_exports.dart b/packages/serverpod_test/lib/serverpod_test_public_exports.dart index 5ce18e3275..c1e3bbd344 100644 --- a/packages/serverpod_test/lib/serverpod_test_public_exports.dart +++ b/packages/serverpod_test/lib/serverpod_test_public_exports.dart @@ -7,9 +7,8 @@ export 'serverpod_test.dart' show AuthenticationOverride, ConnectionClosedException, - flushMicrotasks, + flushEventQueue, InvalidConfigurationException, - ResetTestSessions, RollbackDatabase, ServerpodInsufficientAccessException, ServerpodUnauthenticatedException, diff --git a/packages/serverpod_test/lib/src/test_session.dart b/packages/serverpod_test/lib/src/test_session.dart index e7d06ed9a5..353bb82bc3 100644 --- a/packages/serverpod_test/lib/src/test_session.dart +++ b/packages/serverpod_test/lib/src/test_session.dart @@ -36,8 +36,8 @@ abstract class TestSession implements DatabaseAccessor { /// AuthenticationInfo for the session. Future get authenticationInfo; - /// Access to the message central - MessageCentralAccess get messages; + /// Gets the unerlying Serverpod session + Session get serverpodSession; /// Creates a new unique session with the provided properties. /// This is useful for setting up different session states in the tests @@ -57,6 +57,7 @@ class InternalTestSession extends TestSession { final bool _enableLogging; /// The underlying Serverpod session + @override InternalServerpodSession serverpodSession; @override @@ -67,9 +68,6 @@ class InternalTestSession extends TestSession { return serverpodSession.authenticated; } - @override - MessageCentralAccess get messages => serverpodSession.messages; - @override Transaction? get transaction => serverpodSession.transactionManager.currentTransaction; @@ -121,11 +119,9 @@ class InternalTestSession extends TestSession { } } - /// Resets the internal state of the test session - /// and recreates the underlying Serverpod session. - Future resetState() async { + /// Recreates the underlying Serverpod session. + Future recreateServerpodSession() async { await serverpodSession.close(); - _authenticationOverride = null; serverpodSession = _testServerpod.createSession( enableLogging: _enableLogging, rollbackDatabase: serverpodSession.rollbackDatabase, diff --git a/packages/serverpod_test/lib/src/util.dart b/packages/serverpod_test/lib/src/util.dart index bf45d23de4..6fe5e1b184 100644 --- a/packages/serverpod_test/lib/src/util.dart +++ b/packages/serverpod_test/lib/src/util.dart @@ -1,4 +1,4 @@ -/// Test helper to flush all pending microtasks. +/// Test helper to flush the event queue. /// Useful for waiting for async events to complete before continuing the test. /// /// For example, if depending on a generator function to execute up to its `yield`, then the @@ -9,8 +9,8 @@ /// await flushEventQueue(); /// ``` /// -/// Implemenation note: `Future.delayed` will be put on the event loop since it's a timer. -/// Items on the event loop are not processed until all pending microtasks are completed. -Future flushMicrotasks() { +/// Implemenation note: `Future.delayed` will be put last in the event queue since it's a timer. +/// This will ensure that all other events are processed before the `Future.delayed` event. +Future flushEventQueue() { return Future.delayed(Duration.zero); } diff --git a/packages/serverpod_test/lib/src/with_serverpod.dart b/packages/serverpod_test/lib/src/with_serverpod.dart index faff6b3486..54820d4489 100644 --- a/packages/serverpod_test/lib/src/with_serverpod.dart +++ b/packages/serverpod_test/lib/src/with_serverpod.dart @@ -35,16 +35,6 @@ class InvalidConfigurationException implements Exception { } } -/// Options for when to reset the test session and recreate -/// the underlying Serverpod session during the test lifecycle. -enum ResetTestSessions { - /// After each test. This is the default. - afterEach, - - /// After all tests. - afterAll, -} - /// Options for when to rollback the database during the test lifecycle. enum RollbackDatabase { /// After each test. This is the default. @@ -70,11 +60,9 @@ void Function(TestClosure) buildWithServerpod( String testGroupName, TestServerpod testServerpod, { - ResetTestSessions? maybeResetTestSessions, RollbackDatabase? maybeRollbackDatabase, bool? maybeEnableSessionLogging, }) { - var resetTestSessions = maybeResetTestSessions ?? ResetTestSessions.afterEach; var rollbackDatabase = maybeRollbackDatabase ?? RollbackDatabase.afterEach; List allTestSessions = []; @@ -112,10 +100,8 @@ void Function(TestClosure) await transactionManager.addSavePoint(); } - if (resetTestSessions == ResetTestSessions.afterEach) { - for (var testSession in allTestSessions) { - await testSession.resetState(); - } + for (var testSession in allTestSessions) { + await testSession.recreateServerpodSession(); } await GlobalStreamManager.closeAllStreams(); diff --git a/tests/serverpod_test_server/test_integration/method_streaming_cancel_test.dart b/tests/serverpod_test_server/test_integration/method_streaming_cancel_test.dart index e31d2a0cbd..528d4dccb0 100644 --- a/tests/serverpod_test_server/test_integration/method_streaming_cancel_test.dart +++ b/tests/serverpod_test_server/test_integration/method_streaming_cancel_test.dart @@ -25,7 +25,7 @@ void main() { var stream = endpoints.methodStreaming.getBroadcastStream(session); // Wait for the stream to be created, otherwise cancel is called before creation - await flushMicrotasks(); + await flushEventQueue(); var subscription = stream.listen((event) {}); await subscription.cancel(); @@ -45,7 +45,7 @@ void main() { var stream = endpoints.methodStreaming.getBroadcastStream(session); // Wait for the stream to be created, otherwise cancel is called before creation - await flushMicrotasks(); + await flushEventQueue(); var subscription = stream.listen((event) {}); await subscription.cancel(); diff --git a/tests/serverpod_test_server/test_integration/test_tools/authentication_validation_test.dart b/tests/serverpod_test_server/test_integration/test_tools/authentication_validation_test.dart index f6a624b828..096fd1473f 100644 --- a/tests/serverpod_test_server/test_integration/test_tools/authentication_validation_test.dart +++ b/tests/serverpod_test_server/test_integration/test_tools/authentication_validation_test.dart @@ -131,7 +131,7 @@ void main() { 'and the authenticated user is revoked then stream is closed with ConnectionClosedException.', () async { await expectLater( - session.messages.authenticationRevoked( + session.serverpodSession.messages.authenticationRevoked( authenticatedUserId, RevokedAuthenticationUser(), ), @@ -153,7 +153,7 @@ void main() { 'and the required scope for an endpoint is revoked then stream is closed with ConnectionClosedException.', () async { await expectLater( - session.messages.authenticationRevoked( + session.serverpodSession.messages.authenticationRevoked( authenticatedUserId, RevokedAuthenticationScope(scopes: ['user']), ), @@ -235,7 +235,7 @@ void main() { 'and the authenticated user is revoked then streams are closed with ConnectionClosedException.', () async { await expectLater( - session.messages.authenticationRevoked( + session.serverpodSession.messages.authenticationRevoked( authenticatedUserId, RevokedAuthenticationUser(), ), @@ -261,7 +261,7 @@ void main() { 'and the required scope for an endpoint is revoked then streams are closed with ConnectionClosedException.', () async { await expectLater( - session.messages.authenticationRevoked( + session.serverpodSession.messages.authenticationRevoked( authenticatedUserId, RevokedAuthenticationScope(scopes: ['user']), ), diff --git a/tests/serverpod_test_server/test_integration/test_tools/reset_test_session_test.dart b/tests/serverpod_test_server/test_integration/test_tools/reset_test_session_test.dart deleted file mode 100644 index ca4ddc5309..0000000000 --- a/tests/serverpod_test_server/test_integration/test_tools/reset_test_session_test.dart +++ /dev/null @@ -1,172 +0,0 @@ -import 'package:serverpod/serverpod.dart'; -import 'package:test/test.dart'; - -import 'serverpod_test_tools.dart'; - -void main() { - withServerpod( - 'Given no explicit resetTestSessions configuration when having multiple test cases', - (endpoints, session) { - group('when copying the session in the first test', () { - late TestSession newSession; - - test( - 'then first test has modified newSession that should be reset due to default resetTestSessions.afterEach configuration', - () async { - newSession = session.copyWith( - authentication: AuthenticationOverride.authenticationInfo( - 123, - {}, - ), - ); - - await expectLater( - newSession.authenticationInfo, - completion((a) => a.userId == 123), - ); - }); - - test( - 'then the second test has the reset newSession due to default resetTestSessions.afterEach configuration', - () async { - await expectLater(newSession.authenticationInfo, completion(isNull)); - }); - }); - }, - runMode: ServerpodRunMode.production, - ); - - withServerpod( - 'Given resetTestSessions set to afterEach', - (endpoints, session) { - group('when copying the session in setUpAll', () { - late TestSession newSession; - setUpAll(() async { - newSession = session.copyWith( - authentication: AuthenticationOverride.authenticationInfo( - 123, - {}, - ), - ); - }); - - test('then the first test has the modified newSession', () async { - await expectLater( - newSession.authenticationInfo, - completion((a) => a.userId == 123), - ); - }); - - test('then the second test has the reset newSession', () async { - await expectLater(newSession.authenticationInfo, completion(isNull)); - }); - }); - - group('when copying the session in setUp', () { - late TestSession newSession; - setUp(() async { - newSession = session.copyWith( - authentication: AuthenticationOverride.authenticationInfo( - 123, - {}, - ), - ); - }); - - test('then the first test has the modified newSession', () async { - await expectLater( - newSession.authenticationInfo, - completion((a) => a.userId == 123), - ); - }); - - test('then the second test has the modified newSession', () async { - await expectLater( - newSession.authenticationInfo, - completion((a) => a.userId == 123), - ); - }); - }); - - group('when copying the session in the first test', () { - late TestSession newSession; - - test('then the first test has the modified newSession', () async { - newSession = session.copyWith( - authentication: AuthenticationOverride.authenticationInfo( - 123, - {}, - ), - ); - - await expectLater( - newSession.authenticationInfo, - completion((a) => a.userId == 123), - ); - }); - - test('then the second test has the reset newSession', () async { - await expectLater(newSession.authenticationInfo, completion(isNull)); - }); - }); - }, - resetTestSessions: ResetTestSessions.afterEach, - runMode: ServerpodRunMode.production, - ); - - withServerpod( - 'Given resetTestSessions set to afterAll', - (endpoints, session) { - group('when modifying the session in setUpAll', () { - setUpAll(() async { - session = session.copyWith( - authentication: AuthenticationOverride.authenticationInfo( - 123, - {Scope('user')}, - ), - ); - }); - - test('then the first test has the modified session', () async { - await expectLater( - session.authenticationInfo, - completion((a) => a.userId == 123), - ); - }); - - test('then the second test also has the modified session', () async { - await expectLater( - session.authenticationInfo, - completion((a) => a.userId == 123), - ); - }); - }); - - group('when copying the session in the first test', () { - late TestSession newSession; - - test('then the first test has the modified newSession', () async { - newSession = session.copyWith( - authentication: AuthenticationOverride.authenticationInfo( - 333, - {}, - )); - - await expectLater( - newSession.authenticationInfo, - completion((a) => a.userId == 333), - ); - }); - - test('then the second test has the reset newSession', () async { - await expectLater( - newSession.authenticationInfo, - completion((a) => a.userId == 333), - ); - }); - }); - }, - resetTestSessions: ResetTestSessions.afterAll, - runMode: ServerpodRunMode.production, - ); -} diff --git a/tests/serverpod_test_server/test_integration/test_tools/return_and_input_types_test.dart b/tests/serverpod_test_server/test_integration/test_tools/return_and_input_types_test.dart index 9a945271a2..86990f7640 100644 --- a/tests/serverpod_test_server/test_integration/test_tools/return_and_input_types_test.dart +++ b/tests/serverpod_test_server/test_integration/test_tools/return_and_input_types_test.dart @@ -55,7 +55,7 @@ void main() { var stream = endpoints.testTools.listenForNumbersOnSharedStream(userSession1); - await flushMicrotasks(); + await flushEventQueue(); await endpoints.testTools.postNumberToSharedStream(userSession2, 111); await endpoints.testTools.postNumberToSharedStream(userSession2, 222); diff --git a/tests/serverpod_test_server/test_integration/test_tools/serverpod_test_tools.dart b/tests/serverpod_test_server/test_integration/test_tools/serverpod_test_tools.dart index 39bb7c7c53..f1b823ce13 100644 --- a/tests/serverpod_test_server/test_integration/test_tools/serverpod_test_tools.dart +++ b/tests/serverpod_test_server/test_integration/test_tools/serverpod_test_tools.dart @@ -8,6 +8,8 @@ // ignore_for_file: type_literal_in_constant_pattern // ignore_for_file: use_super_parameters +// ignore_for_file: no_leading_underscores_for_local_identifiers + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod_test/serverpod_test.dart' as _i1; import 'package:serverpod/serverpod.dart' as _i2; @@ -44,7 +46,6 @@ export 'package:serverpod_test/serverpod_test_public_exports.dart'; withServerpod( String testGroupName, _i1.TestClosure testClosure, { - _i1.ResetTestSessions? resetTestSessions, _i1.RollbackDatabase? rollbackDatabase, String? runMode, bool? enableSessionLogging, @@ -59,7 +60,6 @@ withServerpod( runMode: runMode, applyMigrations: applyMigrations, ), - maybeResetTestSessions: resetTestSessions, maybeRollbackDatabase: rollbackDatabase, maybeEnableSessionLogging: enableSessionLogging, )(testClosure); @@ -341,10 +341,12 @@ class _AsyncTasksEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -364,10 +366,12 @@ class _AsyncTasksEndpoint { parameters: {'seconds': seconds}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -395,10 +399,12 @@ class _AuthenticationEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -415,10 +421,12 @@ class _AuthenticationEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -442,10 +450,12 @@ class _AuthenticationEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -471,10 +481,12 @@ class _AuthenticationEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i4.AuthenticationResponse>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -491,10 +503,12 @@ class _AuthenticationEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -518,10 +532,12 @@ class _AuthenticationEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -552,10 +568,12 @@ class _BasicTypesEndpoint { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -575,10 +593,12 @@ class _BasicTypesEndpoint { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -598,10 +618,12 @@ class _BasicTypesEndpoint { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -621,10 +643,12 @@ class _BasicTypesEndpoint { parameters: {'dateTime': dateTime}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -644,10 +668,12 @@ class _BasicTypesEndpoint { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -667,10 +693,12 @@ class _BasicTypesEndpoint { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i5.ByteData?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -690,10 +718,12 @@ class _BasicTypesEndpoint { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -713,10 +743,12 @@ class _BasicTypesEndpoint { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i6.UuidValue?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -744,10 +776,12 @@ class _CloudStorageEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -771,10 +805,12 @@ class _CloudStorageEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -794,10 +830,12 @@ class _CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i5.ByteData?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -817,10 +855,12 @@ class _CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -840,10 +880,12 @@ class _CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -863,10 +905,12 @@ class _CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -886,10 +930,12 @@ class _CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -909,10 +955,12 @@ class _CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -947,10 +995,12 @@ class _S3CloudStorageEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -970,10 +1020,12 @@ class _S3CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i5.ByteData?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -993,10 +1045,12 @@ class _S3CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1016,10 +1070,12 @@ class _S3CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1039,10 +1095,12 @@ class _S3CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1062,10 +1120,12 @@ class _S3CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1085,10 +1145,12 @@ class _S3CloudStorageEndpoint { parameters: {'path': path}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -1117,10 +1179,12 @@ class _CustomClassProtocolEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i7.ProtocolCustomClass>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -1151,10 +1215,12 @@ class _CustomTypesEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i8.CustomClass>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1174,10 +1240,12 @@ class _CustomTypesEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i8.CustomClass?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1197,10 +1265,12 @@ class _CustomTypesEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i8.CustomClass2>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1220,10 +1290,12 @@ class _CustomTypesEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i8.CustomClass2?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1243,10 +1315,12 @@ class _CustomTypesEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i9.ExternalCustomClass>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1266,10 +1340,12 @@ class _CustomTypesEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i9.ExternalCustomClass?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1289,10 +1365,12 @@ class _CustomTypesEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i10.FreezedCustomClass>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1312,10 +1390,12 @@ class _CustomTypesEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i10.FreezedCustomClass?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -1343,10 +1423,12 @@ class _BasicDatabase { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1366,10 +1448,12 @@ class _BasicDatabase { parameters: {'num': num}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1389,10 +1473,12 @@ class _BasicDatabase { parameters: {'num': num}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1412,10 +1498,12 @@ class _BasicDatabase { parameters: {'numRows': numRows}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1439,10 +1527,12 @@ class _BasicDatabase { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1462,10 +1552,12 @@ class _BasicDatabase { parameters: {'num': num}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i11.SimpleData?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1485,10 +1577,12 @@ class _BasicDatabase { parameters: {'id': id}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i11.SimpleData?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1516,10 +1610,12 @@ class _BasicDatabase { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i12.SimpleDataList?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1539,10 +1635,12 @@ class _BasicDatabase { parameters: {'simpleData': simpleData}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i11.SimpleData>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1562,10 +1660,12 @@ class _BasicDatabase { parameters: {'simpleData': simpleData}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i11.SimpleData>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1585,10 +1685,12 @@ class _BasicDatabase { parameters: {'simpleData': simpleData}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1605,10 +1707,12 @@ class _BasicDatabase { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1625,10 +1729,12 @@ class _BasicDatabase { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1648,10 +1754,12 @@ class _BasicDatabase { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i13.Types>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1671,10 +1779,12 @@ class _BasicDatabase { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i13.Types>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1691,10 +1801,12 @@ class _BasicDatabase { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1711,10 +1823,12 @@ class _BasicDatabase { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1734,10 +1848,12 @@ class _BasicDatabase { parameters: {'id': id}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i13.Types?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1757,10 +1873,12 @@ class _BasicDatabase { parameters: {'id': id}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1780,10 +1898,12 @@ class _BasicDatabase { parameters: {'object': object}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i14.ObjectWithEnum>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1803,10 +1923,12 @@ class _BasicDatabase { parameters: {'id': id}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i14.ObjectWithEnum?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1826,10 +1948,12 @@ class _BasicDatabase { parameters: {'object': object}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i15.ObjectWithObject>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1849,10 +1973,12 @@ class _BasicDatabase { parameters: {'id': id}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i15.ObjectWithObject?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1869,10 +1995,12 @@ class _BasicDatabase { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1889,10 +2017,12 @@ class _BasicDatabase { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -1923,10 +2053,12 @@ class _TransactionsDatabaseEndpoint { parameters: {'num': num}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -1952,10 +2084,12 @@ class _TransactionsDatabaseEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -1986,10 +2120,12 @@ class _DeprecationEndpoint { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2006,10 +2142,12 @@ class _DeprecationEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -2037,10 +2175,12 @@ class _EchoRequestEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2060,10 +2200,12 @@ class _EchoRequestEndpoint { parameters: {'headerName': headerName}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -2098,10 +2240,12 @@ class _EmailAuthTestMethods { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2121,10 +2265,12 @@ class _EmailAuthTestMethods { parameters: {'email': email}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2141,10 +2287,12 @@ class _EmailAuthTestMethods { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2170,10 +2318,12 @@ class _EmailAuthTestMethods { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -2201,10 +2351,12 @@ class _ExceptionTestEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2221,10 +2373,12 @@ class _ExceptionTestEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2241,10 +2395,12 @@ class _ExceptionTestEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -2272,10 +2428,12 @@ class _FailedCallsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2292,10 +2450,12 @@ class _FailedCallsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2313,10 +2473,12 @@ class _FailedCallsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2333,10 +2495,12 @@ class _FailedCallsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2353,10 +2517,12 @@ class _FailedCallsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -2387,10 +2553,12 @@ class _FieldScopesEndpoint { parameters: {'object': object}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2408,10 +2576,12 @@ class _FieldScopesEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i16.ObjectFieldScopes?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -2442,10 +2612,12 @@ class _FutureCallsEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -2476,10 +2648,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2499,10 +2673,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2522,10 +2698,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2545,10 +2723,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2568,10 +2748,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2591,10 +2773,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2614,10 +2798,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2637,10 +2823,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2660,10 +2848,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2683,10 +2873,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2706,10 +2898,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2729,10 +2923,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2752,10 +2948,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2775,10 +2973,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2798,10 +2998,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2821,10 +3023,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2844,10 +3048,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2867,10 +3073,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2890,10 +3098,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2913,10 +3123,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2937,10 +3149,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2960,10 +3174,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -2983,10 +3199,12 @@ class _ListParametersEndpoint { parameters: {'list': list}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -3017,10 +3235,12 @@ class _LoggingEndpoint { parameters: {'seconds': seconds}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3040,10 +3260,12 @@ class _LoggingEndpoint { parameters: {'queries': queries}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3060,10 +3282,12 @@ class _LoggingEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3083,10 +3307,12 @@ class _LoggingEndpoint { parameters: {'delayMillis': delayMillis}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3103,10 +3329,12 @@ class _LoggingEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3123,10 +3351,12 @@ class _LoggingEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3150,10 +3380,12 @@ class _LoggingEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3173,10 +3405,12 @@ class _LoggingEndpoint { parameters: {'message': message}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3202,10 +3436,12 @@ class _LoggingEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3222,10 +3458,12 @@ class _LoggingEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3237,7 +3475,7 @@ class _LoggingEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'logging', method: 'streamEmpty', ) as _i1.InternalTestSession); @@ -3269,7 +3507,7 @@ class _LoggingEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'logging', method: 'streamLogging', ) as _i1.InternalTestSession); @@ -3301,7 +3539,7 @@ class _LoggingEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'logging', method: 'streamQueryLogging', ) as _i1.InternalTestSession); @@ -3366,10 +3604,12 @@ class _LoggingDisabledEndpoint { parameters: {'message': message}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -3400,10 +3640,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3423,10 +3665,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3446,10 +3690,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3469,10 +3715,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3492,10 +3740,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3515,10 +3765,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3538,10 +3790,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3561,10 +3815,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3584,10 +3840,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3607,10 +3865,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3630,10 +3890,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3653,10 +3915,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3676,10 +3940,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3699,10 +3965,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3722,10 +3990,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3745,10 +4015,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3768,10 +4040,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3791,10 +4065,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3814,10 +4090,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3838,10 +4116,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3861,10 +4141,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3885,10 +4167,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3908,10 +4192,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3931,10 +4217,12 @@ class _MapParametersEndpoint { parameters: {'map': map}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -3965,10 +4253,12 @@ class _MethodSignaturePermutationsEndpoint { parameters: {'string': string}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -3988,10 +4278,12 @@ class _MethodSignaturePermutationsEndpoint { parameters: {'string': string}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4011,10 +4303,12 @@ class _MethodSignaturePermutationsEndpoint { parameters: {'string': string}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4034,10 +4328,12 @@ class _MethodSignaturePermutationsEndpoint { parameters: {'string': string}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4061,10 +4357,12 @@ class _MethodSignaturePermutationsEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4088,10 +4386,12 @@ class _MethodSignaturePermutationsEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4115,10 +4415,12 @@ class _MethodSignaturePermutationsEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4130,7 +4432,7 @@ class _MethodSignaturePermutationsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodSignaturePermutations', method: 'echoNamedArgStream', ) as _i1.InternalTestSession); @@ -4161,8 +4463,7 @@ class _MethodSignaturePermutationsEndpoint { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodSignaturePermutations', method: 'echoNamedArgStreamAsFuture', ) as _i1.InternalTestSession); @@ -4192,7 +4493,7 @@ class _MethodSignaturePermutationsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodSignaturePermutations', method: 'echoPositionalArgStream', ) as _i1.InternalTestSession); @@ -4223,8 +4524,7 @@ class _MethodSignaturePermutationsEndpoint { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodSignaturePermutations', method: 'echoPositionalArgStreamAsFuture', ) as _i1.InternalTestSession); @@ -4262,7 +4562,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'simpleStream', ) as _i1.InternalTestSession); @@ -4294,7 +4594,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'neverEndingStreamWithDelay', ) as _i1.InternalTestSession); @@ -4331,10 +4631,12 @@ class _MethodStreaming { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4345,8 +4647,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'intReturnFromStream', ) as _i1.InternalTestSession); @@ -4375,8 +4676,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'nullableIntReturnFromStream', ) as _i1.InternalTestSession); @@ -4403,7 +4703,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'getBroadcastStream', ) as _i1.InternalTestSession); @@ -4440,10 +4740,12 @@ class _MethodStreaming { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4461,10 +4763,12 @@ class _MethodStreaming { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4476,7 +4780,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'intStreamFromValue', ) as _i1.InternalTestSession); @@ -4508,7 +4812,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'intEchoStream', ) as _i1.InternalTestSession); @@ -4540,7 +4844,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'dynamicEchoStream', ) as _i1.InternalTestSession); @@ -4572,7 +4876,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'nullableIntEchoStream', ) as _i1.InternalTestSession); @@ -4603,8 +4907,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'voidReturnAfterStream', ) as _i1.InternalTestSession); @@ -4635,7 +4938,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'multipleIntEchoStreams', ) as _i1.InternalTestSession); @@ -4672,8 +4975,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'directVoidReturnWithStreamInput', ) as _i1.InternalTestSession); @@ -4702,8 +5004,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'directOneIntReturnWithStreamInput', ) as _i1.InternalTestSession); @@ -4732,8 +5033,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'simpleInputReturnStream', ) as _i1.InternalTestSession); @@ -4763,7 +5063,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'simpleStreamWithParameter', ) as _i1.InternalTestSession); @@ -4795,7 +5095,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'simpleDataStream', ) as _i1.InternalTestSession); @@ -4827,7 +5127,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'simpleInOutDataStream', ) as _i1.InternalTestSession); @@ -4864,10 +5164,12 @@ class _MethodStreaming { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4887,10 +5189,12 @@ class _MethodStreaming { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4910,10 +5214,12 @@ class _MethodStreaming { parameters: {'value': value}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4933,10 +5239,12 @@ class _MethodStreaming { parameters: {'delay': delay}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -4948,7 +5256,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'delayedStreamResponse', ) as _i1.InternalTestSession); @@ -4980,8 +5288,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'delayedNeverListenedInputStream', ) as _i1.InternalTestSession); @@ -5011,8 +5318,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'delayedPausedInputStream', ) as _i1.InternalTestSession); @@ -5047,10 +5353,12 @@ class _MethodStreaming { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5061,8 +5369,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'inStreamThrowsException', ) as _i1.InternalTestSession); @@ -5091,8 +5398,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'inStreamThrowsSerializableException', ) as _i1.InternalTestSession); @@ -5119,7 +5425,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'outStreamThrowsException', ) as _i1.InternalTestSession); @@ -5149,7 +5455,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'outStreamThrowsSerializableException', ) as _i1.InternalTestSession); @@ -5180,8 +5486,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'throwsExceptionVoid', ) as _i1.InternalTestSession); @@ -5210,8 +5515,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'throwsSerializableExceptionVoid', ) as _i1.InternalTestSession); @@ -5240,8 +5544,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'throwsException', ) as _i1.InternalTestSession); @@ -5270,8 +5573,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'throwsSerializableException', ) as _i1.InternalTestSession); @@ -5298,7 +5600,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'throwsExceptionStream', ) as _i1.InternalTestSession); @@ -5327,7 +5629,7 @@ class _MethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'throwsSerializableExceptionStream', ) as _i1.InternalTestSession); @@ -5358,8 +5660,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'didInputStreamHaveError', ) as _i1.InternalTestSession); @@ -5388,8 +5689,7 @@ class _MethodStreaming { var _localTestStreamManager = _i1.TestStreamManager(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'methodStreaming', method: 'didInputStreamHaveSerializableExceptionError', ) as _i1.InternalTestSession); @@ -5427,7 +5727,7 @@ class _AuthenticatedMethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'authenticatedMethodStreaming', method: 'simpleStream', ) as _i1.InternalTestSession); @@ -5459,7 +5759,7 @@ class _AuthenticatedMethodStreaming { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'authenticatedMethodStreaming', method: 'intEchoStream', ) as _i1.InternalTestSession); @@ -5507,10 +5807,12 @@ class _ModuleSerializationEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5530,10 +5832,12 @@ class _ModuleSerializationEndpoint { parameters: {'object': object}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i18.ModuleClass>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5551,10 +5855,12 @@ class _ModuleSerializationEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i19.ModuleDatatype>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -5593,10 +5899,12 @@ class _NamedParametersEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5620,10 +5928,12 @@ class _NamedParametersEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -5654,10 +5964,12 @@ class _OptionalParametersEndpoint { parameters: {'optionalInt': optionalInt}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -5692,10 +6004,12 @@ class _RedisEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5719,10 +6033,12 @@ class _RedisEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5742,10 +6058,12 @@ class _RedisEndpoint { parameters: {'key': key}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i11.SimpleData?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5765,10 +6083,12 @@ class _RedisEndpoint { parameters: {'key': key}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5785,10 +6105,12 @@ class _RedisEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5808,10 +6130,12 @@ class _RedisEndpoint { parameters: {'channel': channel}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i11.SimpleData?>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5835,10 +6159,12 @@ class _RedisEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -5855,10 +6181,12 @@ class _RedisEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -5887,10 +6215,12 @@ class _ServerOnlyScopedFieldModelEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i20.ScopeServerOnlyField>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -5918,10 +6248,12 @@ class _SignInRequiredEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -5949,10 +6281,12 @@ class _AdminScopeRequiredEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -5987,10 +6321,12 @@ class _SimpleEndpoint { }, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6007,10 +6343,12 @@ class _SimpleEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6027,10 +6365,12 @@ class _SimpleEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6050,10 +6390,12 @@ class _SimpleEndpoint { parameters: {'name': name}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -6095,10 +6437,12 @@ class _SubSubDirTestEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -6126,10 +6470,12 @@ class _SubDirTestEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -6157,10 +6503,12 @@ class _TestToolsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future<_i6.UuidValue>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6178,10 +6526,12 @@ class _TestToolsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6191,7 +6541,7 @@ class _TestToolsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'testTools', method: 'returnsSessionIdFromStream', ) as _i1.InternalTestSession); @@ -6221,7 +6571,7 @@ class _TestToolsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'testTools', method: 'returnsSessionEndpointAndMethodFromStream', ) as _i1.InternalTestSession); @@ -6261,10 +6611,12 @@ class _TestToolsEndpoint { parameters: {'string': string}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6276,7 +6628,7 @@ class _TestToolsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'testTools', method: 'returnsStream', ) as _i1.InternalTestSession); @@ -6307,8 +6659,7 @@ class _TestToolsEndpoint { var _localTestStreamManager = _i1.TestStreamManager>(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'testTools', method: 'returnsListFromInputStream', ) as _i1.InternalTestSession); @@ -6338,7 +6689,7 @@ class _TestToolsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'testTools', method: 'returnsStreamFromInputStream', ) as _i1.InternalTestSession); @@ -6378,10 +6729,12 @@ class _TestToolsEndpoint { parameters: {'number': number}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6393,7 +6746,7 @@ class _TestToolsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'testTools', method: 'postNumberToSharedStreamAndReturnStream', ) as _i1.InternalTestSession); @@ -6422,7 +6775,7 @@ class _TestToolsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'testTools', method: 'listenForNumbersOnSharedStream', ) as _i1.InternalTestSession); @@ -6462,10 +6815,12 @@ class _TestToolsEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6483,10 +6838,12 @@ class _TestToolsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future>); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6506,10 +6863,12 @@ class _TestToolsEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6529,10 +6888,12 @@ class _TestToolsEndpoint { parameters: {'data': data}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6550,10 +6911,12 @@ class _TestToolsEndpoint { parameters: {}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } } @@ -6584,10 +6947,12 @@ class _AuthenticatedTestToolsEndpoint { parameters: {'string': string}, serializationManager: _serializationManager, ); - return (_localCallContext.method.call( + var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession.serverpodSession, _localCallContext.arguments, ) as _i3.Future); + await _localUniqueSession.serverpodSession.close(); + return _localReturnValue; }); } @@ -6599,7 +6964,7 @@ class _AuthenticatedTestToolsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'authenticatedTestTools', method: 'returnsStream', ) as _i1.InternalTestSession); @@ -6630,8 +6995,7 @@ class _AuthenticatedTestToolsEndpoint { var _localTestStreamManager = _i1.TestStreamManager>(); return _i1 .callAwaitableFunctionWithStreamInputAndHandleExceptions(() async { - var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + var _localUniqueSession = ((session as _i1.InternalTestSession).copyWith( endpoint: 'authenticatedTestTools', method: 'returnsListFromInputStream', ) as _i1.InternalTestSession); @@ -6661,7 +7025,7 @@ class _AuthenticatedTestToolsEndpoint { _i1.callStreamFunctionAndHandleExceptions( () async { var _localUniqueSession = - (await (session as _i1.InternalTestSession).copyWith( + ((session as _i1.InternalTestSession).copyWith( endpoint: 'authenticatedTestTools', method: 'intEchoStream', ) as _i1.InternalTestSession); diff --git a/tests/serverpod_test_server/test_integration/test_tools/session_copy_with_test.dart b/tests/serverpod_test_server/test_integration/test_tools/session_copy_with_test.dart new file mode 100644 index 0000000000..46ce480814 --- /dev/null +++ b/tests/serverpod_test_server/test_integration/test_tools/session_copy_with_test.dart @@ -0,0 +1,69 @@ +import 'package:serverpod/serverpod.dart'; +import 'package:test/test.dart'; + +import 'serverpod_test_tools.dart'; + +void main() { + withServerpod( + 'Given calling `copyWith` on the session', + (endpoints, session) { + group('when setting a new shared session on the group level', () { + TestSession modifiedSession = session.copyWith( + authentication: AuthenticationOverride.authenticationInfo( + 123, + {}, + ), + ); + + test( + 'then the first test gets the modifiedSession according to the group assignment', + () async { + await expectLater( + modifiedSession.authenticationInfo, + completion((a) => a.userId == 123), + ); + }); + test( + 'then the second test gets the modifiedSession according to the group assignment', + () async { + await expectLater( + modifiedSession.authenticationInfo, + completion((a) => a.userId == 123), + ); + }); + }); + + group( + 'when setting a new shared session on the group level ' + 'and copying the session in the first test', () { + TestSession modifiedSession = session.copyWith( + authentication: AuthenticationOverride.unauthenticated(), + ); + + test('then the first test can change it', () async { + modifiedSession = session.copyWith( + authentication: AuthenticationOverride.authenticationInfo( + 123, + {}, + ), + ); + + await expectLater( + modifiedSession.authenticationInfo, + completion((a) => a.userId == 123), + ); + }); + + test( + 'then the second test gets the modifiedSession according to the first test', + () async { + await expectLater( + modifiedSession.authenticationInfo, + completion((a) => a.userId == 123), + ); + }); + }); + }, + runMode: ServerpodRunMode.production, + ); +} diff --git a/tools/serverpod_cli/lib/src/generator/dart/library_generators/server_test_tools_generator.dart b/tools/serverpod_cli/lib/src/generator/dart/library_generators/server_test_tools_generator.dart index 073c696884..afb0f57c32 100644 --- a/tools/serverpod_cli/lib/src/generator/dart/library_generators/server_test_tools_generator.dart +++ b/tools/serverpod_cli/lib/src/generator/dart/library_generators/server_test_tools_generator.dart @@ -180,16 +180,26 @@ class ServerTestToolsGenerator { 'serializationManager': refer('_serializationManager'), })) .statement, - refer('_localCallContext') - .property('method') - .property('call') - .call([ - refer('_localUniqueSession').property('serverpodSession'), - refer('_localCallContext').property('arguments'), - ]) - .asA(method.returnType.reference(true, config: config)) - .returned + refer('var _localReturnValue') + .assign( + refer('_localCallContext') + .property('method') + .property('call') + .call([ + refer('_localUniqueSession').property('serverpodSession'), + refer('_localCallContext').property('arguments'), + ]) + .asA(method.returnType.reference(true, config: config)) + .awaited, + ) .statement, + refer('_localUniqueSession') + .property('serverpodSession') + .property('close') + .call([]) + .awaited + .statement, + refer('_localReturnValue').returned.statement, ]) ..returns, ).closure; @@ -220,11 +230,9 @@ class ServerTestToolsGenerator { .asA(refer('InternalTestSession', serverpodTestUrl)) .property('copyWith') .call([], { - 'endpoint': literalString(endpoint.name), - 'method': literalString(method.name), - }) - .awaited - .asA(refer('InternalTestSession', serverpodTestUrl))) + 'endpoint': literalString(endpoint.name), + 'method': literalString(method.name), + }).asA(refer('InternalTestSession', serverpodTestUrl))) .statement, refer('var _localCallContext') .assign(refer('_endpointDispatch') @@ -389,10 +397,6 @@ class ServerTestToolsGenerator { ..type = refer('TestClosure', serverpodTestUrl)), ]) ..optionalParameters.addAll([ - Parameter((p) => p - ..name = 'resetTestSessions' - ..named = true - ..type = refer('ResetTestSessions?', serverpodTestUrl)), Parameter((p) => p ..name = 'rollbackDatabase' ..named = true @@ -432,7 +436,6 @@ class ServerTestToolsGenerator { ), ], { - 'maybeResetTestSessions': refer('resetTestSessions'), 'maybeRollbackDatabase': refer('rollbackDatabase'), 'maybeEnableSessionLogging': refer('enableSessionLogging'), }, @@ -457,5 +460,7 @@ class ServerTestToolsGenerator { Directive.import(endpointsPath), Directive.export(serverpodTestPublicExportsUrl), ]); + + library.ignoreForFile.add('no_leading_underscores_for_local_identifiers'); } } diff --git a/tools/serverpod_cli/test/generator/dart/server_code_generator/test_tools_test.dart b/tools/serverpod_cli/test/generator/dart/server_code_generator/test_tools_test.dart index 5ed669e3e3..24fda72c34 100644 --- a/tools/serverpod_cli/test/generator/dart/server_code_generator/test_tools_test.dart +++ b/tools/serverpod_cli/test/generator/dart/server_code_generator/test_tools_test.dart @@ -64,7 +64,6 @@ void main() { r'withServerpod\(\n' r' String testGroupName,\n' r' _i\d\.TestClosure testClosure, \{\n' - r' _i\d\.ResetTestSessions\? resetTestSessions,\n' r' _i\d\.RollbackDatabase\? rollbackDatabase,\n' r' String\? runMode,\n' r' bool\? enableSessionLogging,\n' @@ -132,7 +131,6 @@ void main() { r'withServerpod\(\n' r' String testGroupName,\n' r' _i\d\.TestClosure testClosure, \{\n' - r' _i\d\.ResetTestSessions\? resetTestSessions,\n' r' _i\d\.RollbackDatabase\? rollbackDatabase,\n' r' String\? runMode,\n' r' bool\? enableSessionLogging,\n' @@ -178,7 +176,6 @@ void main() { r'withServerpod\(\n' r' String testGroupName,\n' r' _i\d\.TestClosure testClosure, \{\n' - r' _i\d\.ResetTestSessions\? resetTestSessions,\n' r' _i\d\.RollbackDatabase\? rollbackDatabase,\n' r' String\? runMode,\n' r' bool\? enableSessionLogging,\n' @@ -258,7 +255,6 @@ void main() { r'withServerpod\(\n' r' String testGroupName,\n' r' _i\d\.TestClosure testClosure, \{\n' - r' _i\d\.ResetTestSessions\? resetTestSessions,\n' r' _i\d\.RollbackDatabase\? rollbackDatabase,\n' r' String\? runMode,\n' r' bool\? enableSessionLogging,\n'