`DeltaCrdt.get/3` doesn't have a matching implementation in `DeltaCrdt.CausalCrdt`
hexedpackets opened this issue · comments
There doesn't seem to be an handler for the {:get, keys}
message in DeltaCrdt.CausalCrdt
, causing DeltaCrdt.get/3
to always crash. It looks like the GenServer expects to get a message in the form of {:read, keys}
instead.
Example:
iex> DeltaCrdt.get(App.Crdt, :data)
[error] GenServer App.Crdt terminating
** (FunctionClauseError) no function clause matching in DeltaCrdt.CausalCrdt.handle_call/3
(delta_crdt 0.6.2) lib/delta_crdt/causal_crdt.ex:188: DeltaCrdt.CausalCrdt.handle_call({:get, [:data]}, {#PID<0.496.0>, #Reference<0.1390650936.464519170.185368>}, %DeltaCrdt.CausalCrdt{crdt_module: DeltaCrdt.AWLWWMap, crdt_state: %DeltaCrdt.AWLWWMap{dots: %{308441501 => 1, 832333321 => 1}, value: %{data: %{{%{}, -576460750822203482} => #MapSet<[{308441501, 1}]>, {%{}, -576460750512409489} => #MapSet<[{832333321, 1}]>}}}, max_sync_size: 200, merkle_map: %MerkleMap{map: %{data: %{{%{}, -576460750822203482} => #MapSet<[{308441501, 1}]>, {%{}, -576460750512409489} => #MapSet<[{832333321, 1}]>}}, merkle_tree: %MerkleMap.MerkleTree{tree: {<<242, 89, 53, 225>>, {<<5, 163, 213, 97>>, %{data: %{{%{}, -576460750822203482} => #MapSet<[{308441501, 1}]>, {%{}, -576460750512409489} => #MapSet<[{832333321, 1}]>}}}}}}, name: App.Crdt, neighbour_monitors: %{{App.Crdt, :app@node} => #Reference<0.1390650936.464519173.183426>}, neighbours: #MapSet<[{App.Crdt, :app@node}]>, node_id: 308441501, on_diffs: nil, outstanding_syncs: %{}, sequence_number: 0, storage_module: nil, sync_interval: 200})
(stdlib 3.14.1) gen_server.erl:715: :gen_server.try_handle_call/4
(stdlib 3.14.1) gen_server.erl:744: :gen_server.handle_msg/6
(stdlib 3.14.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message (from App.Client): {:get, [:data]}
iex> GenServer.call(App.Crdt, {:read, [:data]})
%{data: %{}}