@@ -210,7 +210,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
210210
211211 setup do
212212 session_id = "test_session_#{ :rand . uniform ( 1_000_000 ) } "
213- { :ok , pid } = SessionProcess . start_session ( session_id , TestSessionProcess )
213+ { :ok , pid } = SessionProcess . start_session ( session_id , module: TestSessionProcess )
214214
215215 on_exit ( fn ->
216216 if Process . alive? ( pid ) do
@@ -427,7 +427,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
427427 session_id = "test_invalid_string_#{ :rand . uniform ( 1_000_000 ) } "
428428
429429 { :error , { exception , _stacktrace } } =
430- SessionProcess . start_session ( session_id , InvalidStringSession )
430+ SessionProcess . start_session ( session_id , module: InvalidStringSession )
431431
432432 assert % ArgumentError { } = exception
433433 assert exception . message =~ ~r/ Invalid combined_reducers entry/
@@ -445,7 +445,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
445445 session_id = "test_invalid_int_#{ :rand . uniform ( 1_000_000 ) } "
446446
447447 { :error , { exception , _stacktrace } } =
448- SessionProcess . start_session ( session_id , InvalidIntegerSession )
448+ SessionProcess . start_session ( session_id , module: InvalidIntegerSession )
449449
450450 assert % ArgumentError { } = exception
451451 assert exception . message =~ ~r/ Invalid combined_reducers entry/
@@ -463,7 +463,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
463463 session_id = "test_invalid_tuple_#{ :rand . uniform ( 1_000_000 ) } "
464464
465465 { :error , { exception , _stacktrace } } =
466- SessionProcess . start_session ( session_id , InvalidTupleSession )
466+ SessionProcess . start_session ( session_id , module: InvalidTupleSession )
467467
468468 assert % ArgumentError { } = exception
469469 assert exception . message =~ ~r/ Invalid combined_reducers entry/
@@ -484,7 +484,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
484484 session_id = "test_dup_module_#{ :rand . uniform ( 1_000_000 ) } "
485485
486486 { :error , { exception , _stacktrace } } =
487- SessionProcess . start_session ( session_id , DuplicateModuleSession )
487+ SessionProcess . start_session ( session_id , module: DuplicateModuleSession )
488488
489489 assert % ArgumentError { } = exception
490490 assert exception . message =~ ~r/ Duplicate reducer name: :users/
@@ -505,7 +505,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
505505 session_id = "test_dup_name_#{ :rand . uniform ( 1_000_000 ) } "
506506
507507 { :error , { exception , _stacktrace } } =
508- SessionProcess . start_session ( session_id , DuplicateNameSession )
508+ SessionProcess . start_session ( session_id , module: DuplicateNameSession )
509509
510510 assert % ArgumentError { } = exception
511511 assert exception . message =~ ~r/ Duplicate reducer name: :users/
@@ -528,7 +528,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
528528 session_id = "test_non_reducer_#{ :rand . uniform ( 1_000_000 ) } "
529529
530530 { :error , { exception , _stacktrace } } =
531- SessionProcess . start_session ( session_id , NonReducerSession )
531+ SessionProcess . start_session ( session_id , module: NonReducerSession )
532532
533533 assert % ArgumentError { } = exception
534534 assert exception . message =~ ~r/ not a reducer module/
@@ -546,7 +546,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
546546 session_id = "test_nonexistent_#{ :rand . uniform ( 1_000_000 ) } "
547547
548548 { :error , { exception , _stacktrace } } =
549- SessionProcess . start_session ( session_id , NonExistentModuleSession )
549+ SessionProcess . start_session ( session_id , module: NonExistentModuleSession )
550550
551551 assert % ArgumentError { } = exception
552552 assert exception . message =~ ~r/ Could not load reducer module/
@@ -564,7 +564,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
564564 end
565565
566566 session_id = "test_empty_#{ :rand . uniform ( 1_000_000 ) } "
567- { :ok , _pid } = SessionProcess . start_session ( session_id , EmptyListSession )
567+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: EmptyListSession )
568568
569569 state = SessionProcess . get_state ( session_id )
570570 assert state . count == 0
@@ -593,7 +593,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
593593 end
594594
595595 session_id = "mixed_format_#{ :rand . uniform ( 1_000_000 ) } "
596- { :ok , _pid } = SessionProcess . start_session ( session_id , MixedFormatSession )
596+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: MixedFormatSession )
597597
598598 state = SessionProcess . get_state ( session_id )
599599
@@ -644,7 +644,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
644644 end
645645
646646 session_id = "default_prefix_#{ :rand . uniform ( 1_000_000 ) } "
647- { :ok , _pid } = SessionProcess . start_session ( session_id , DefaultPrefixSession )
647+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: DefaultPrefixSession )
648648
649649 state = SessionProcess . get_state ( session_id )
650650 assert state . inventory == % { stock: 100 }
@@ -670,7 +670,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
670670 end
671671
672672 session_id = "no_init_#{ :rand . uniform ( 1_000_000 ) } "
673- { :ok , _pid } = SessionProcess . start_session ( session_id , NoInitStateSession )
673+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: NoInitStateSession )
674674
675675 state = SessionProcess . get_state ( session_id )
676676 # Should be %{} because NotificationsReducer has no init_state/0
@@ -700,7 +700,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
700700 end
701701
702702 session_id = "mixed_init_#{ :rand . uniform ( 1_000_000 ) } "
703- { :ok , _pid } = SessionProcess . start_session ( session_id , MixedInitSession )
703+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: MixedInitSession )
704704
705705 state = SessionProcess . get_state ( session_id )
706706 assert state . users == % { users: [ ] , fetch_count: 0 , search_query: nil }
@@ -725,7 +725,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
725725 end
726726
727727 session_id = "map_format_#{ :rand . uniform ( 1_000_000 ) } "
728- { :ok , _pid } = SessionProcess . start_session ( session_id , MapFormatSession )
728+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: MapFormatSession )
729729
730730 state = SessionProcess . get_state ( session_id )
731731 assert state . users == % { users: [ ] , fetch_count: 0 , search_query: nil }
@@ -757,7 +757,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
757757 end
758758
759759 session_id = "custom_prefix_#{ :rand . uniform ( 1_000_000 ) } "
760- { :ok , _pid } = SessionProcess . start_session ( session_id , CustomPrefixSession )
760+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: CustomPrefixSession )
761761
762762 state = SessionProcess . get_state ( session_id )
763763 assert state . shipping == % { address: nil , cost: 0 }
@@ -785,7 +785,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
785785 end
786786
787787 session_id = "same_prefix_#{ :rand . uniform ( 1_000_000 ) } "
788- { :ok , _pid } = SessionProcess . start_session ( session_id , SamePrefixSession )
788+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: SamePrefixSession )
789789
790790 state = SessionProcess . get_state ( session_id )
791791 assert state . primary_users == % { users: [ ] , fetch_count: 0 , search_query: nil }
@@ -814,7 +814,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
814814 end
815815
816816 session_id = "special_chars_#{ :rand . uniform ( 1_000_000 ) } "
817- { :ok , _pid } = SessionProcess . start_session ( session_id , SpecialCharsSession )
817+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: SpecialCharsSession )
818818
819819 state = SessionProcess . get_state ( session_id )
820820 assert state . special_chars_test == % { data: "test" }
@@ -841,7 +841,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
841841 end
842842
843843 session_id = "underscore_hyphen_#{ :rand . uniform ( 1_000_000 ) } "
844- { :ok , _pid } = SessionProcess . start_session ( session_id , UnderscoreHyphenSession )
844+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: UnderscoreHyphenSession )
845845
846846 state = SessionProcess . get_state ( session_id )
847847 assert Map . has_key? ( state , :user_profile )
@@ -875,7 +875,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
875875 end
876876
877877 session_id = "stress_test_#{ :rand . uniform ( 1_000_000 ) } "
878- { :ok , _pid } = SessionProcess . start_session ( session_id , StressTestSession )
878+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: StressTestSession )
879879
880880 state = SessionProcess . get_state ( session_id )
881881
@@ -922,7 +922,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
922922 end
923923
924924 session_id = "prefix_meta_#{ :rand . uniform ( 1_000_000 ) } "
925- { :ok , pid } = SessionProcess . start_session ( session_id , PrefixMetadataSession )
925+ { :ok , pid } = SessionProcess . start_session ( session_id , module: PrefixMetadataSession )
926926
927927 # Access internal state to verify prefix storage
928928 internal_state = :sys . get_state ( pid )
@@ -951,7 +951,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
951951
952952 session_id = "same_prefix_diff_#{ :rand . uniform ( 1_000_000 ) } "
953953 # Should not raise - same prefix with different names is valid
954- { :ok , _pid } = SessionProcess . start_session ( session_id , SamePrefixDiffModulesSession )
954+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: SamePrefixDiffModulesSession )
955955
956956 state = SessionProcess . get_state ( session_id )
957957 assert Map . has_key? ( state , :users )
@@ -973,7 +973,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
973973 end
974974
975975 session_id = "throttle_debounce_list_#{ :rand . uniform ( 1_000_000 ) } "
976- { :ok , _pid } = SessionProcess . start_session ( session_id , ThrottleDebounceListSession )
976+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: ThrottleDebounceListSession )
977977
978978 # Test throttle still works
979979 SessionProcess . dispatch ( session_id , "fetch-users" )
@@ -1012,7 +1012,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
10121012 end
10131013
10141014 session_id = "subscription_list_#{ :rand . uniform ( 1_000_000 ) } "
1015- { :ok , _pid } = SessionProcess . start_session ( session_id , SubscriptionListSession )
1015+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: SubscriptionListSession )
10161016
10171017 { :ok , _sub_id } =
10181018 SessionProcess . subscribe (
@@ -1036,7 +1036,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
10361036 alias Phoenix.SessionProcess.Action
10371037
10381038 session_id = "routing_explicit_#{ :rand . uniform ( 1_000_000 ) } "
1039- { :ok , _pid } = SessionProcess . start_session ( session_id , TestSessionProcess )
1039+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: TestSessionProcess )
10401040
10411041 # Dispatch with explicit reducer targeting - only UserReducer should get it
10421042 SessionProcess . dispatch ( session_id , "add-user" , "Alice" , reducers: [ :users ] )
@@ -1061,7 +1061,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
10611061
10621062 test "routes action to multiple specified reducers" do
10631063 session_id = "routing_multi_#{ :rand . uniform ( 1_000_000 ) } "
1064- { :ok , _pid } = SessionProcess . start_session ( session_id , TestSessionProcess )
1064+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: TestSessionProcess )
10651065
10661066 # Dispatch to both UserReducer and CartReducer
10671067 SessionProcess . dispatch ( session_id , "add-user" , "Bob" , reducers: [ :users , :cart ] )
@@ -1078,7 +1078,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
10781078
10791079 test "no routing metadata calls all reducers" do
10801080 session_id = "routing_all_#{ :rand . uniform ( 1_000_000 ) } "
1081- { :ok , _pid } = SessionProcess . start_session ( session_id , TestSessionProcess )
1081+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: TestSessionProcess )
10821082
10831083 # Dispatch without routing metadata - goes to all reducers
10841084 SessionProcess . dispatch ( session_id , "add-user" , "Charlie" )
@@ -1108,7 +1108,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
11081108 end
11091109
11101110 session_id = "routing_prefix_#{ :rand . uniform ( 1_000_000 ) } "
1111- { :ok , _pid } = SessionProcess . start_session ( session_id , PrefixRoutingSession )
1111+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: PrefixRoutingSession )
11121112
11131113 # Dispatch "user.fetch-users" - should route to UserReducer only
11141114 SessionProcess . dispatch ( session_id , "user.fetch-users" )
@@ -1129,7 +1129,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
11291129
11301130 test "explicit prefix filter overrides inferred prefix" do
11311131 session_id = "routing_explicit_prefix_#{ :rand . uniform ( 1_000_000 ) } "
1132- { :ok , _pid } = SessionProcess . start_session ( session_id , TestSessionProcess )
1132+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: TestSessionProcess )
11331133
11341134 # Even though action type is "cart.add", explicitly route to users reducer
11351135 SessionProcess . dispatch (
@@ -1151,7 +1151,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
11511151
11521152 test "action without dot notation goes to all reducers" do
11531153 session_id = "routing_no_prefix_#{ :rand . uniform ( 1_000_000 ) } "
1154- { :ok , _pid } = SessionProcess . start_session ( session_id , TestSessionProcess )
1154+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: TestSessionProcess )
11551155
11561156 # Action type has no dot, so no prefix to route by - goes to all
11571157 SessionProcess . dispatch ( session_id , "add-user" , "Dave" )
@@ -1176,7 +1176,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
11761176 end
11771177
11781178 session_id = "routing_custom_prefix_#{ :rand . uniform ( 1_000_000 ) } "
1179- { :ok , _pid } = SessionProcess . start_session ( session_id , CustomPrefixSession )
1179+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: CustomPrefixSession )
11801180
11811181 # Action with "ship.calculate-shipping" should route to ShippingReducer
11821182 # After prefix stripping, becomes "calculate-shipping" which matches the handler
@@ -1207,7 +1207,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
12071207 end
12081208
12091209 session_id = "routing_performance_#{ :rand . uniform ( 1_000_000 ) } "
1210- { :ok , _pid } = SessionProcess . start_session ( session_id , CountingSession )
1210+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: CountingSession )
12111211
12121212 # Dispatch to only users
12131213 SessionProcess . dispatch ( session_id , "test-action" , nil , reducers: [ :users ] )
@@ -1256,7 +1256,7 @@ defmodule Phoenix.SessionProcess.ReducerIntegrationTest do
12561256 end
12571257
12581258 session_id = "routing_many_#{ :rand . uniform ( 1_000_000 ) } "
1259- { :ok , _pid } = SessionProcess . start_session ( session_id , ManyReducersSession )
1259+ { :ok , _pid } = SessionProcess . start_session ( session_id , module: ManyReducersSession )
12601260
12611261 # Dispatch with "user." prefix - should only call user1 and user2
12621262 SessionProcess . dispatch ( session_id , "user.action" )
0 commit comments